英语翻译_root.stop();bar._xscale = 0;onEnterFrame = function (){var _loc5 = _root.getBytesLoaded();var _loc4 = _root.getBytesTotal();var _loc3 = int(_loc5 / _loc4 * 100);baifenbi = _loc3;bar._xscale = _loc3;if (_loc3 == 100 && _loc4 > 20){delete
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/16 08:53:41
英语翻译_root.stop();bar._xscale = 0;onEnterFrame = function (){var _loc5 = _root.getBytesLoaded();var _loc4 = _root.getBytesTotal();var _loc3 = int(_loc5 / _loc4 * 100);baifenbi = _loc3;bar._xscale = _loc3;if (_loc3 == 100 && _loc4 > 20){delete
英语翻译
_root.stop();
bar._xscale = 0;
onEnterFrame = function ()
{
var _loc5 = _root.getBytesLoaded();
var _loc4 = _root.getBytesTotal();
var _loc3 = int(_loc5 / _loc4 * 100);
baifenbi = _loc3;
bar._xscale = _loc3;
if (_loc3 == 100 && _loc4 > 20)
{
delete this.onEnterFrame;
_root.play();
} // end if
};
英语翻译_root.stop();bar._xscale = 0;onEnterFrame = function (){var _loc5 = _root.getBytesLoaded();var _loc4 = _root.getBytesTotal();var _loc3 = int(_loc5 / _loc4 * 100);baifenbi = _loc3;bar._xscale = _loc3;if (_loc3 == 100 && _loc4 > 20){delete
这段代码主要是用于显示下载进度.
_root.stop();:先让动画或游戏停止.
bar._xscale = 0;:先让“bar”元件(下载进度条)的宽度为0.
onEnterFrame = function ():设立监听器,使之后不断执行“{ }”里面的代码,直到监听器被删除.
{
var _loc5 = _root.getBytesLoaded();:获取已下载字节数.
var _loc4 = _root.getBytesTotal();:获取总字节数.
var _loc3 = int(_loc5 / _loc4 * 100);:获取已下载字节数百分比.
baifenbi = _loc3;:在名为“baifenbi”的文本框内显示已下载字节数百分比.
bar._xscale = _loc3;:让下载进度条用宽度显示已下载字节数百分比.
if (_loc3 == 100 && _loc4 > 20):如果以下载100%,而且总字节数>20,就执行“{ }”里面的代码.
{
delete this.onEnterFrame;:删除监听器.
_root.play();:使动画或游戏继续播放(此时已下载完毕)
} // end if
};