all groups > flash actionscript > march 2006 >
You're in the

flash actionscript

group:

Loading External Files One at a Time.


Loading External Files One at a Time. DadrianKaelan
3/16/2006 11:48:51 PM
flash actionscript:
I have a thumbnail gallery with A LOT of thumbnails in it and the problem I'm
having is that they all try to load right away when the page comes up (this is
using the MovieClipLoader's loadClip()) -- or they load in groups. And tested
on dialup things get really funky.

So I wanted to know if any knew how to basically have one external file load,
then move to the next all the way down the line until all the thumbnails are
loaded? Instead of making them all try to load at once.

--Mike

Re: Loading External Files One at a Time. blemmo
3/17/2006 2:58:17 AM
Put all the thumbnail urls in an array, and have a method that loads an array
entry depending on an index counter, e.g.
function loadOne(index:Number){
myMCL.load(pic_array, "destination_mc"+index);
}

Then have a loop (onEnterFrame or setInterval), that tracks the progress
(index) and checks the loading of the currently loading pic. If the loading is
finished, it calls loadOne with the next index or stops the loop, when the last
array entry is reached.
That's a basic outline... hope it helps.

cheers,
blemmo
Re: Loading External Files One at a Time. Rothrock
3/17/2006 3:06:17 AM
I would recommend something similar to what blemmo has outlined for you here.
But instead of putting it in an onEnterFrame or setInterval I would recommend
incrementing and starting the next load when the onLoadComplete or onLoadInit
event of the MovieClipLoad happens.
Re: Loading External Files One at a Time. DadrianKaelan
3/17/2006 3:52:48 AM
Thank you both so much. I'm working on a testing version of what was suggested. Hopefully there's no problems!

Thanks again.

AddThis Social Bookmark Button