Jump to content
Search Community

LoaderMax problem after multiple appends above 24 Loaders

Cor test
Moderator Tag

Recommended Posts

I have several buttons which present albums with photos.

When I click an album button, several images get loaded.

Here is the callback function of the button:

 

private function loadImages():void {
		if (conThumbs) {
			container.removeChild(conThumbs);				
		}
		conThumbs = new Sprite();
		conMain.addChild(conThumbs);
		//create a LoaderMax named "mainQueue" and set up onProgress, onComplete and onError listeners
		var ldrQueue:LoaderMax = new LoaderMax( { name:"childQueue", maxConnections:1, onChildComplete:completeHandler } );
		var w:uint = 75;
		var h:uint = 48;
		for (var i:int = 0; i < aURLs.length; i++)			{
			ldrQueue.append( new ImageLoader(aURLs[i], {container:conThumbs, x:offSetX+(i % 5) * w, y:offSetY+int(i / 5) * h, width:w, height:h}) );
		}
		ldrQueue.load();			
	}//end loadImages

 

Every click on another button loads the images correctly up to 24 loaders and after that it does trace it loaded the image but it doesn't appear on screen anymore?

Link to comment
Share on other sites

Could you please post an FLA that demonstrates the issue so that we can publish it and see the problem? That would be REALLY helpful in terms of troubleshooting. There's no limit to the number of files you can preload, so I doubt this has anything to do with LoaderMax.

 

No need to post your production files - just something simple that demonstrates it.

Link to comment
Share on other sites

Here is the problem source:

 

http://www.codobyte.com/!problem/LoaderMaxProblem.zip (REMOVED)

 

Click on the little menu several times and notice it doesn't show the images after it has loaded 24 images.

I know the whole concept looks stupid, because it cal all be done with LoaderMax and XML in a much better way, but this is my first try with LoaderMax.

 

So any other comment for me to learn a better approach is VERY welcome too.

 

Kind regards

Cor

Link to comment
Share on other sites

The way you built your app is definitely causing the issue - you keep reloading the same assets with different loaders and never dispose() any of them, so the memory keeps escalating. And the mere fact that you keep reloading the same content with different (new) loaders each time you need it means that you're missing out on one of the biggest benefits of LoaderMax. You should just load the assets once and use LoaderMax.getContent("myLoaderName") to get the content whenever you need it. This will not only eliminate the memory issues but it will make your application much, much faster for the user because no reloading is necessary.

 

Does that clear things up for you?

Link to comment
Share on other sites

Yes, I understand what I was doing, but I don't know the proper way... yet.

I am trying to figure out how to get to use LoaderMax for this in the most beneficial way.

And by trying to implement it in the way I use to load/build my pages/site, is wrong.

 

I am looking for some more tutorials or examples that would help me.

Is there any available other then what I found on greensock.com?

 

Most of all: Thank you for your answer!

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