AS 3 Dynamic Creation of Display Objects From Library
Posted on 2012-08-13
I've got a FLA file here with about 250 bitmaps inside the library. I've added them all as actionscript classes - with names Class01, Class02, Class03, etc...
I'd like my script to dynamically pull them in...but I'm missing a part of the syntax. Here's what I have.
var t:Number = 05;
var y:DisplayObject = "Class"+t;
var myBitmapDataObject:y = new y(100, 100);
var myImage:Bitmap = new Bitmap(myBitmapDataObject);
How would you do that? Clearly I'm missing something.