Copying greensock LoaderMax ContentDisplay item
In order to copy a ContentDisplay item and thus be able to use the same bitmap asset multiple times in your application, you need to clone its BitmapData and make a new Bitmap out of it. Like so:
public function getCopyOfAsset(asset:String):Bitmap
{
// get asset from your LoaderMax queue
var content:ContentDisplay = myLoaderMax.getContent(asset);
// access and clone source bitmap's BitmapData
var bmp:Bitmap = new Bitmap(Bitmap(content.getChildAt(0)).bitmapData.clone());
return bmp;
}
Kommentare
Kommentar veröffentlichen