I have a .fla that has a preloader on frame one and the rest of the file on frames 2 thru 55. The preloader code is the one that comes in Flash cs5's sample files. there is a movie clip with the instance name lbar and text with the name lpc. here is the code
stop();
import flash.display.*;
this.stop
this.loaderInfo.addEventListener (ProgressEvent.PROGRESS, PL_LOADING);
function PL_LOADING(event:Prog开发者_Go百科ressEvent):void {
var pcent:Number=event.bytesLoaded/event.bytesTotal*100;
lbar.scaleX=pcent/100;
lpc.text=int(pcent)+"%";
lpc.z = pcent/100
if(pcent==100){
this.gotoAndPlay(2);
}
}
It works fine the first time people are on my site but when the page is refreshed or is gone back to sometimes the loader bar is just stuck and doesnt load.
Any help is greatly appreciated! Thanks
The problem was in firefox. It now works because of some javascript coding
精彩评论