Basically, to attach a bitmap from a library, you will do the following:
import flash.display.BitmapData;
import flash.display.Bitmap;
var bmp:BitmapData = new ClassNameOfTheBitmap(0, 0);
var img = new Bitmap(bmp);
addChild(img);
But since you do not know the name of the class, you will have to dynamically create the class as follows:
import flash.display.BitmapData;
import flash.display.Bitmap;
var classNameFromFlashvars:String = "xxx";
var cls:Class = getDefinitionByName(classNameFromFlashvars) as Class;
var bmp:BitmapData = new cls(0, 0) as BitmapData;
var img = new Bitmap(bmp);
addChild(img);
In this case, the class name in the image binding properties will be xxx.
source
share