Anyone know of a for loop that would do this loading? I tried it this way:
var str:String;
var numArray:Array = new Array();
for (i=0; i<10; i++)
{
str = "TT" + String(i);
numArray[i] = new str();
}
But I get compiler errors. I didn’t think it would work since there is nothing named str in the Library. The movie clips are named:TT0, TT1,...,TT9. All exported for ActionScript.
The long, boring way would work of course:
numArray[0] = new TT0();
numArray[1] = new TT1();
.
.
.
numArray[9] = new TT9();
I am working in Flash CS3 in AS3.0. Thanks for any tricks you would like to share.
Edit:I just thought of another way:
var numArray:Array = [new TT0(), new TT1(),...,new TT9()];
But that seems kinda wild! |