简体   繁体   English

预加载器在IE中拖动flash电影

[英]Preloader stalling flash movie in IE

This is only a problem in IE. 这只是IE中的一个问题。

the following actionscript is for a simple preloader for a movie i'm working on. 以下动作脚本用于我正在处理的电影的简单预加载器。 It works fine in Firefox but the movie stops on the first frame of the preloader when opened with Internet Explorer. 它在Firefox中工作正常但是当使用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);
}
}

Watch out for division-by-zero errors! 注意分零错误!

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

You cannot assume that loaderInfo knows the total number of bytes. 您不能假设loaderInfo知道总字节数。 Sometimes the sever wont tell the browser how big the file is going to be. 有时,服务器不会告诉浏览器文件的大小。 In your case the file was probably already cached by Firefox but not IE. 在你的情况下,文件可能已经被Firefox缓存但不是IE。

Some people solve this by letting the swf know the file size beforehand, others configure their webserver to send this information. 有些人通过让swf事先知道文件大小来解决这个问题,其他人则将其网络服务器配置为发送此信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM