Forum Moderators: open

Message Too Old, No Replies

Preloaders

Preloader wont work

         

Hammo

3:48 pm on Mar 23, 2006 (gmt 0)

10+ Year Member



I have made a basic preloader that is going to load an image and then move to frame 2,where the image will be displayed.

My problem is the LoadBar doesnt change its x value and the dynamic text box doesnt display the percentage loaded. However when i test the movie, it waits as if its loading the image and then it moves to frame 2.

So basically everything is working except the loadBar and the percent loaded text.

Here is the Actionscript i have been using:

---------------------

_root.stop();
var percLoaded:Number = 0;
var newPercLoaded:Number;
onEnterFrame = preload;
function preload():Void {
newPercLoaded = Math.floor(_root.getBytesLoaded()/_root.getBytesTotal()*100);
LoadBar._xscale = percLoaded=percLoaded+(newPercLoaded-percLoaded)*.2;
if (percLoaded>99.9 && newPercLoaded == 100) {
stop();
_root.nextFrame();
delete this.onEnterFrame;
}
}

-------------------------------

Any help would be greatly appreciated
Thanks Hammo