How to add numbered objects from library to array (Flash AS3)?
Posted on 2011-09-29
Plain and simple. I have 8 Buttons. The linkage class names are bINC1 through bINC8. I want to assign them to an array so I can do stuff with them.
I could maybe go something like:
myArray:bINC1 = new bINC1();
myArray:bINC2 = new bINC2();
But that's pretty tedious.
I can't do this, however, in a for/next loop like this one (after defining "n"):
myArray:bINC1 = new ("bINC" + n)();
because that throws up an error.
This is a foundation for some larger arrays of buttons and MC's and I'd like to find a way to do this....