Jump to content
GreenSock

chrisatflash

loading sequence, when using a higher maxConnectoin ?

Recommended Posts

Hello,

I am using the parse method of the LoaderMax with a maxConnection of 4.

 

like this:

var urls:Array = ["img4.jpg", "img5.jpg", "img3.jpg", "img2.jpg"];

_que = LoaderMax.parse(urls, { maxConnection:4, onChildComplete:_childCompleteHandler}, { width:80, height:110, scaleMode:"strech"});

 

in the method onChildComplete i have:

 

private function _childCompleteHandler(event:LoaderEvent):void {

var currentContent : ContentDisplay = event.target.content;

trace(event.target + " finished)

}

 

The strangest thing is, that img4 is about 3MB and the others are about 10kb. I would think that the img4.jpg would be loaded as last, but

that is not the case.

With the above urls in this sequence, i get onChildComplete first ( img5, img4, img3, img2), but that shoud be (img2, img5, img3, img4)

 

What am i doing wrong? Or is not the way the loader works when using a higher MaxConnection, that the lightest file is loaded first and the largest file is loaded last?

 

And / Or is there a way to pass a array of estimateBytes that correspond with the urls Array?

Link to comment
Share on other sites

You spelled "maxConnections" wrong (you were missing the "s" on the end). So it was defaulting to 2. But even in that case, if the numbers you mentioned are true, img4.jpg should still load last in most situations (unless you're loading things locally or over an extremely fast connection in which case it would be normal to see the results you're getting). I'm definitely curious to see your files and see what's going on if these files are indeed loading over a regular (not super fast) connection and not locally. Could you post a simple example FLA that demonstrates the behavior and please include the files you're loading too?

Link to comment
Share on other sites

You noticed that i used maxConnection, that should be maxConnetctions :roll: , so i think it's my bad :oops:

I am going to test it online and if there is a problem with it, i will send you the fla and all source code with the to load assets.

 

Thanks Jack! I am just switching from the caurina tweener to your very enhanced tweener and loader classes!

So far excelent work! i'm goint to make a donation soon because it safes me a lot of time :)

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