PDA

View Full Version : preloader issues...


Kimchee
01-19-2009, 03:55 PM
So here is my code for the preloader:



loaderInfo.addEventListener (ProgressEvent.PROGRESS, PL_LOADING);

function PL_LOADING(event:ProgressEvent):void {
var pcent:Number=event.bytesLoaded/event.bytesTotal*100;



if(pcent==100){
gotoAndPlay(2);
}
}

The problem is it works the first time I visit the site, but the second time I visit the site it sticks in the loading stage forever, as if pcent never = 100.

Here is the site if you want to try it out:
http://www.unpracticalmath.com/Toons/toons_intro.html

Kimchee
01-19-2009, 05:47 PM
Got it working, the problem was IE, who would have thought...

So anyway the fix is just to add a if statement outside of your usual preloader stuff, just to check once upon load if percentload == 100.