谁能帮我解释一下下面这段代码的意思

来源:百度知道 编辑:UC知道 时间:2024/06/08 07:42:42
onClipEvent (load) {
m = Stage.width;
n = this._width/2;
x = 3;
}
onClipEvent (enterFrame) {
this._x = this._x-x;
if (this._x>=n) {
this._x = this._x-n;
}
if (this._x<=m-n) {
this._x = this._x+n;
}
}

onClipEvent (load) {
m = Stage.width; //这句应该是 m = Stage._width;这样吧!
n = this._width/2;
x = 3;
}
这段代码意思是说,当一个(不知道你这是影片还是什么)被加载的时候触发的.m是Stage原件的宽度.n是当前被加载原件宽度的一半!

onClipEvent (enterFrame) {
this._x = this._x-x;
if (this._x>=n) {
this._x = this._x-n; //被加载完毕的这个原件坐标右移3个单位!this._x是这个原件的很坐标!
}
if (this._x<=m-n) {
this._x = this._x+n;
}
}
应该是加载完毕的时候触发的.