i’m porting an old AS2 project to AS3, And have encounter a problem. I’ve tried a few different things but had no success.
in AS2 when dynamically attaching a MC from the library i would sometimes use an array. the array would hold linkage reference’s, like so;
var mc:String = state_ar[currentState];
this.container.attachMovie(mc,mc,this.getNextHighestDepth());
targetMC = this.container[mc];
How would i do this in AS3?
You would do that using getDefinition() or getDefinitionByName()
Check out this answer for code, your situation sounds quite similar.
Note: The only difference is you might be using MovieClips, not images, so you won’t need the 0,0 arguments in the constructor.