预加载器在 IE 中停止 Flash 影片

发布于 2024-08-30 17:50:19 字数 468 浏览 2 评论 0原文

这只是 IE 中的问题。

以下动作脚本是我正在制作的电影的简单预加载器。它在 Firefox 中工作正常,但当使用 Internet Explorer 打开时,影片会停在预加载器的第一帧上。以前有人遇到过这个问题吗?

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);
}
}

This is only a problem in 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. 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);
}
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天气好吗我好吗 2024-09-06 17:50:19

注意除零错误!

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

您不能假设 loaderInfo 知道字节总数。有时服务器不会告诉浏览器文件有多大。在你的情况下,该文件可能已经被 Firefox 缓存,但不是 IE 缓存。

有些人通过预先让 swf 了解文件大小来解决此问题,其他人则配置其网络服务器来发送此信息。

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

Some people solve this by letting the swf know the file size beforehand, others configure their webserver to send this information.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文