hello flashcoders,
i have two fundamental questions. they somewhat keep bothering me:
1. what are the datatypes of a MovieClip instance and a Textfield
instance after calling "removeMovieClip()"/"removeTextField()" on that
MovieClip/Textfield instance?
2. do they remain in the memory after
"removeMovieClip()"/"removeTextField()"? do i need to "delete" the
references to them in order to have them "garbage collected"?
pls see below:
var tn:MovieClip = this.createEmptyMovieClip("tn", 0);
var tn_nested:MovieClip = tn.createEmptyMovieClip("tnNested", 0);
var tf_nested:TextField = tn.createTextField("tf", 1, 0, 100, 100, 100);
tf_nested.text = "hello world!";
tn.loadMovie("http://assets0.twitter.com/images/twitter.png?1175908827");
destroy_btn.onRelease = function(){
tf_nested.removeTextField();
tn.removeMovieClip();
trace("is tn instanceof MovieClip after removeMovieClip: "+(tn
instanceof MovieClip));//false
trace("is tn instanceof Object after removeMovieClip: "+(tn
instanceof Object));//false
trace("tn type after removeMovieClip: "+ typeof(tn));//movieclip
trace("is tf_nested instanceof Object after removeMovieClip:
"+(tf_nested instanceof Object));//false
trace("tf_nested type after removeMovieClip:
"+(typeof(tf_nested)));//movieclip
trace("tn is "+tn+"; tf_nested is "+tf_nested);//tn is ; tf_nested is
delete tf_nested;
delete tn;
trace(newline+">>>>delete tn>>>>");
trace("tn after destroy: "+(tn instanceof MovieClip));
trace("tn after destroy: "+(tn instanceof Object));
trace("tn type after destroy: "+ typeof(tn));
trace("tf_nested type after destroy: "+(typeof(tf_nested)));
}
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com