Jump to content
GreenSock

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

Moving from one loader to another

Recommended Posts

I have identified the MP3loader I want to move by doing:

var MP3loader:MP3Loader = LoaderMax.getLoader("myLoader");

I tried doing this to remove it from whichever loader it might be in and into the loader I want it to be in: 

MP3loader.parent.remove(MP3loader);
targetLoaderMax.append(MP3loader);

But apparently, "parent" is not a property of MP3Loader. How do I get the parent loaderMax of MP3loader, and is that even necessary? Does appending it to targetLoaderMax automatically remove it from the loaderMax it was previously in?

Link to comment
Share on other sites

From what I know, loaders do not have parents.

 

Appending an MP3Loader to LoaderMax1 and then appending it to LoaderMax2 does not remove it from LoaderMax1 (according to a quick test I did).

 

You can add any data you want to a Loader so maybe you can track which LoaderMax you are putting it in so you can then remove() it. 

 

var queue:LoaderMax = new LoaderMax();

var bird = new ImageLoader("images/bird.png", {container:this, alpha:0, x:320, y:200, estimatedBytes:60000, data:{parent:queue}})

queue.append(bird);

trace("bird parent " + bird.vars.data.parent)
  • Like 1
Link to comment
Share on other sites

Ah, thanks, I didn't know about the data thing. That should be very useful!

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.
×