Foggs

Can I use an LoaderMax ImageLoader multiple times

Recommended Posts

I need to use the same image multiple times, can I just use

var img = LoaderMax.getContent("img");

addChild(img)

var im2  = LoaderMax.getContent("img");

addChild(img2)

 

When I use this code only one image is placed on the stage

 

Share this post


Link to post
Share on other sites

Right, the getContent() method returns the object (not a new copy of it every time). You'd have to do whatever copying you need if you're trying to duplicate something. Like a new Bitmap() using the bitmapData of the other. 

Share this post


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.