Forum Moderators: open
After I close my browser and go back to the site, the preloader just stops at 0% and does not play.
stop();
//Preloader
loaderInfo.addEventListener(ProgressEvent.PROGRESS, updatePreloader);
function updatePreloader(evtObj:ProgressEvent):void {
//Container for the progress of the site (download)
var percent:Number = Math.floor((evtObj.bytesLoaded*100)/evtObj.bytesTotal);
preloader.text = percent+"%";
if (percent==100) {
play();
}
}
I'm thinking I have to do something like this:
if (bytesLoaded == bytesTotal) {
play();
}
or
if (percent==100) {
play();
}
else {
play();
}
That just gives me errors. This is my first time attempting AS3.