Jump to content
Search Community

Reusing a loaded item multiple times

shapevoid test
Moderator Tag

Recommended Posts

Hi, im using loadermax to load in some assets into my project. I can load them in no problems, however Im trying to use certain buttons across different parents, o a close button may appears on multiple screens of my app. I have tried adding the same aset multiple times or either via the Content Display or the rawContent property, but can only add the item multiple times If I make a regular flash bitmap out of it... which is easy enough o do.. just cant help but think im missing something easy here that will allow me to use the same loaded asset in multiple places

 

Thanks

s

Link to comment
Share on other sites

Yep, that's correct - Flash doesn't provide a way to just duplicate an asset like that except Bitmaps, if you use the same BitmapData. That kinda makes sense because of state issues (imagine a sub-swf has certain variables and state-related properties set - it'd be virtually impossible for Flash to know all of that and set all of those appropriately on the copy).

 

And by the way, ImageLoader does that for you automatically internally if you create another ImageLoader with the same URL that has already been loaded. It'll very quickly copy the same BitmapData for you so that you don't need to wait for the asset to load. 

Link to comment
Share on other sites

  • 2 months later...

Hello,

 

Does this also refers to SwfLoader, if I load swf and then wnat to use that swf in many places do I also just create new SwfLoader with same url and I will wont need to wait for swf to load.

 

Thanks

Link to comment
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.
×
×
  • Create New...