FLASH代码求解

来源:百度知道 编辑:UC知道 时间:2024/05/26 11:22:24
for (var i in _root) {
_root[i].stop();
_root[i].onRollOver = function() {
this.onEnterFrame = function() {

if (this._currentframe<this._totalframes) {

this.nextFrame();
} else {

delete this.onEnterFrame;

}
};
};
_root[i].onRollOut = function() {
this.onEnterFrame = function() {
if (this._currentframe>1) {
this.prevFrame();
} else {
delete this.onEnterFrame;
}
};
};
}
"var i in _root"怎么解释啊?
delete this.onEnterFrame;
是什么意思啊

var是局部变量,i是变量名称 _root是根路径
以上都是自定义声名的一个变量,只要格式不变,名字可以随意取,但是不能是中文。
大概意思就是,首先是停止的,当鼠标滑过的时候执行函数自定义“function”
delete this.onEnterFrame; 就是如果不符合“this._currentframe<this._totalframes”这个条件,即当前祯数小于总祯数,就清除。
“this.onEnterFrame = function (){”是指按 Return 或 Enter 键,并键入以下内容来创建在播放头进入第 1 帧(您将在该帧上附加脚本)时运行的函数