+ -
当前位置:首页 → 问答吧 → 怎么让loading飞一会儿

怎么让loading飞一会儿

时间:2011-06-11

来源:互联网

请教高手,我做一个网站,载入每个swf都有一个loading,同时有个简单的动画,我想让loading无论如何都能快速的显示从1-100,有办法吗?网上好多的,但只有在真正加载或第一次加载时显示loading,一旦本地或网上加载过就不显示这个loading,有办法吗?

作者: cnrui   发布时间: 2011-06-11

loading 很好看?

可以判断一下时间,如果加载过程太短就自己假装一个进度用enterFrame或者setInterval控制.

但是,我个人觉得loading没什么好看,不出现是好

作者: flash023   发布时间: 2011-06-11

不是好看,是想有个切换的效果。这 个判断真没做过,我把代码贴出来,看有办法改吗?
this.onLoad=function(){
myBytesTotal=_root.getBytesTotal();
}
this.onLoad();
this.onEnterFrame=function(){
myBytesLoaded=_root.getBytesLoaded();
bar_xscale=myBytesLoaded/myBytesTotal*100;
percent=Math.round(bar_xscale);
this.bar._xscale=bar_xscale;
this.bar_per=percent+"%";

if(myBytesLoaded==myBytesTotal)
{
    delete this.onEnterFrame;
    _root.nextFrame();
}else{
    this.stop();
}
}

作者: cnrui   发布时间: 2011-06-11