Preloader stops flash movie in IE

This is only a problem in IE.

The following actionscript file is for a simple preloader for the movie I'm working on. It works fine in Firefox, but the movie stops in the first frame of the preloader when opened using Internet Explorer. Has anyone had this problem before?

stop();

addEventListener(Event.ENTER_FRAME,checkLoad);
function checkLoad(e:Event):void {
var pcent:Number=this.loaderInfo.bytesLoaded /this.loaderInfo.bytesTotal*100;
bar_mc.scaleX=pcent/100;
loader_txt.text=int(pcent)+"%";
if (pcent==100) {
removeEventListener(Event.ENTER_FRAME,checkLoad);
this.gotoAndPlay(2);
}
}
+3
source share
1 answer

Watch for division by zero errors!

var pcent:Number=this.loaderInfo.bytesLoaded /this.loaderInfo.bytesTotal*100;

You cannot assume that you loaderInfoknow the total number of bytes. Sometimes the server does not tell the browser how large the file is. In your case, the file was probably already cached by Firefox, but not IE.

, SWF , - .

+3

Source: https://habr.com/ru/post/1742483/


All Articles