Basically instead of var thing_mc:test_mc=new test_mc I want to somehow do thing_mc:String=new String, where String is defined by an array. I’ve tried several methods and searched all over, but I can’t find out how to do this. I don’t know if I’m not searching for the right thing or what, but I just can’t find an answer.
Example of what I want:
var anarray:Array=new Array
anarray[0]="thismc"
anarray[1]="thatmc"
var thing_mc:anarray[0]=new anarray[0]
addChild(thing_mc)
I know what’s obviously wrong, but I don’t know what’s right and that’s the easiest to understand example of what I’m trying to achieve.
You could use
But worth noting is that the classnames you’re referencing in your array DO need to be imported somewhere in your project else the application won’t be able to find those classes at runtime.