Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
overbyte

[solved] retrieving multiple copies of image from LoaderMax

Recommended Posts

hi folks

 

Does anyone know if it's possible to retrieve multiple copies of the same loaded image as you can with bulkloader?

 

thanks

obie

Link to post
Share on other sites

answer

 

get the images rawContent (should be a bitmap if there were no security sandbox issues) then use it's data property to get a BitmapData object which you can then use in as many bitmaps as you want.

 

i ended up doing something quite similar but using bitmapdata.draw() from the content instead:

 

public function getImageById(id:String):Bitmap
{
if (!retrievedItems[id])
{
	retrievedItems[id] = LoaderMax.getContent(id);
}

var item:DisplayObject = retrievedItems[id];
var bmd:BitmapData = new BitmapData(item.width, item.height, true, 0);
bmd.draw(item);

return new Bitmap(bmd, "auto", true);
}

 

obie

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×