PDA

View Full Version : preloader != working on the internet


iumeda
05-29-2004, 05:44 PM
I've made a pretty simple preloader that works just fine on my machine when I "test movie" in Flash MX 2004 Pro. The preloader is part of a placeholder for JPGs and SWFs that are loaded in dynamically. Here is the code:

onClipEvent(load){
var init = true,
loadingText = "";

loadbar._yscale = imgButton._yscale = imgH;
imgButton._xscale = loadbar._xscale = imgW;
loadbar.bar._xscale = 0;
}

onClipEvent(enterFrame){
if(init){
B = this.loader.getBytesLoaded();
T = this.loader.getBytesTotal();
loadbar._visible = true;
loadbar.loadingText = "loading\n"+B+" / "+T;
loadbar.bar._xscale = 100*B/T;
if(B >= T){
loadbar._visible = false;
init = false;
}
}
}

. . . when played online it behaves like B (which is getBytesLoaded) is immediately >= T (getBytesTotal) and so loadbar (the preloading movie) is set to invisible prematurely.

Ideas? Thanks.

farafiro
05-30-2004, 06:59 AM
iumeda
welcoe tothe forums

what is the "imgButton"??
in order tomakeapreloader works perfect, u may include nothing in its frame but the bar and the text field
and make it seperate, not a part of anything else

iumeda
05-30-2004, 02:02 PM
Thanks for your reply. I suppose more detail on what I am trying to do is in order.

This script resides in the parent movie clip of a bunch of other movie clips that make up a image placeholder. They are (1) loadbar, (2) imgButton, and (3) loader (which does not appear in the script). loadbar is the preloading movie, imgButton is a button that lies on top of the image for user interaction with the image, loader is the placeholder for the loaded image.

You are suggesting that i make the preloader an autonomous movie clip but the way i have constructed this object (as far as I know) the preloader is seperate from the rest but it's function resides in its parent movie clip. Are you saying that I should have the function for the preloader reside in the preloader movie clip itself? I don't know how that would make any difference but I will try.

I suppose my question is why is the behavior different between the authoring environment and the internet?

Thanks again.

farafiro
05-31-2004, 12:50 AM
I donno whay it behaves different, I should see the file
but try to change the bandwidth profiler in flash and test it