I am creating some MovieClips like so:
var AClip:A = new A();
var A2Clip:A2 = new A2();
var A3Clip:A3 = new A3();
I then put the above into an array and am trying to trace out thier “name”.
for(var i:int=0;i<theArray.length;i++){
trace(theArray[i].name);
}
This traces
instance99
instance77
instanceN...
What I want to accomplish is the trace is tracing out what I “initialized” them to
AClip
A2Clip
A3Clip
Is there a way to do that?
Thanks
Variable’s name is not the same as MovieClip’s name. You have to set its name manualy:
Then you can get their name by calling trace(theArray[i].name);