This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Flash Site Design > June 2004 > Preloader for multiple external files





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Preloader for multiple external files
msum1park

2004-06-25, 7:15 pm

Q1.

When using the MovieClipLoader class, does it mean that I can't load files
from local address (from my hard drive)?
I have no problems loading, it's just that my preloader wouldn't work (doesn't
scale when the movie is loading).
I'm using MX 2004

mcLoader = new MovieClipLoader();
loadListener = new Object();
mcLoader.addListener(loadListener);
mcLoader.loadClip("largeMovie.swf", loader_mc);
loadListener.onLoadStart = function() {
loader_mc.stop();
};

//this is the part where it doesn't work
loadListener.onLoadProgress = function(loadTarget, loadedBytes, totalBytes) {
preloaded = Math.floor(loadedBytes/totalBytes*100);
loaderText_txt.text = preloaded+"% loaded into "+loadTarget;
bar_mc._xscale = preloaded;
};

loadListener.onLoadComplete = function() {
loaderText_txt._visible = false;
bar_mc._visible = false;
loader_mc.play();
};


--------------------------------------------------------------------------------
-------
Q2.

Since I can't use the above method, I'm having a hard time trying to reuse the
preloader to load multiple external files.

I'm now trying a movie clip loader_mc to load my movies/jpeg. How do I get the
amount of bytes (of target file) loaded?

I've tried the following but I know it's wrong.

loader_mc.getBytesLoaded();

Can someone advise or give a hint?

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews