the idea is to access MC's on the stage with sequantial instance names,
for example: mc1, mc2, mc3 …
now, in as2 i would do: this["mc" + i]
(where "i" represents a number between 1-3)
how would i do such thing in as3?
thanks in advance
actionscript-3flash
the idea is to access MC's on the stage with sequantial instance names,
for example: mc1, mc2, mc3 …
now, in as2 i would do: this["mc" + i]
(where "i" represents a number between 1-3)
how would i do such thing in as3?
thanks in advance
Best Answer
If mc1,mc2,mc3 are located on the top level of your fla, and there are no other clips bellow them ( e.g. mc1 has has depth(index) 1, mc2 has index 2, etc. ) you could get the clips using getChildAt();
if you're not sure about depth management, just name your clips ( if they're on stage, give them instance names, if they're created at runtime, use the name property (mc1.name = 'mc1'))
and use getChildByName() to get them
I'm sure there a lot of resouces if you just google as2 as3 migration