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