第一帧:
this.onLoad=function(){
myBytesTotal=_root.getBytesTotal();
}
this.onLoad();
this.onEnterFrame=function(){
myBytesLoaded=_root.getBytesLoaded();
bar_xscale=myBytesLoaded/myBytesTotal*100;
t=getTimer();
rate= "下载速度:" + Math.round(myBytesLoaded/t * 100)/100 + " K/s";
timeLoaded=Math.round(t/1000);
timeRemain=Math.round(timeLoaded*(myBytesTotal-myBytesLoaded)/myBytesLoaded);
timeRemain=Math.round(timeRemain/60)+":"+Math.round(timeRemain%60);
timeLoaded=Math.round(timeLoaded/60)+":"+Math.round(timeLoaded%60);
mytimes="已用时间"+timeLoaded+" "+"剩余时间"+timeRemain;
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();
}
}
第二帧stop;
发表评论
关闭窗口 来源:网络 16 2009-03-16