Jump to content

Tim Jaramillo

ImageLoader XML - local publishing lag when loading 100s of images

Recommended Posts

Hey guys,


I'm using ImageLoader nodes in an XML file, to auto-load 500 images (total load weight around 20 megs). I'm using Flash Pro CC.


An example node looks like this:

<ImageLoader url="assets/images/patterns/thumb/pattern-0-thumb.png" name="pattern_thumb_0" load="true" />


When exporting locally from Flash, there's a 10 second lag as LoaderMax process all the images. I've attached 3 screenshots from Scout, and it looks like 87% of that 10 second-time is taken up by Flash sending URL requests for the images. When the files are up on a server everything runs normally (I expect a 10 second load on a server), but when running locally I'd expect the content to load almost immediately, but instead I'm getting the same 10 second lag.


I understand that by setting load=true, LoaderMax is loading all the images at start, which is what I want.


I'm wondering if this 10 second process time is normal for a local Flash export? And if I were to create the ImageLoaders via AS (rather than automatically via XML), would this 10 second local export be reduced? Or is there any other way to reduce this process time when exporting locally (keeping in mind I need to load all the images at app startup). 


Thanks for any insight.




Link to comment
Share on other sites

Yes, this seems normal for Flash and is easily replicated without ImageLoader or XMLLoader.


Try this simple loop of loading 500 of the same image


for (var i:int = 0; i < 500; i++) {
 var loader:Loader =new Loader();
 loader.x = i*2;
 loader.y = Math.random()* 400;
 loader.load(new URLRequest("img.png"));

Using a 100kb image for img.png I had at least an 8 second delay.


I believe in the browser Flash is limited to 16 simultaneous loads. Not sure how it works on desktop but it looks like instantiating hundreds of Loaders (which is what LoaderMax does behind the scenes) is not going to perform well. 

Link to comment
Share on other sites

I see, thanks for clearing this up for me, Carl.

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.