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