onEnterFrame = function () 的一个问题
做闪吧的实例教程的时候发现,为什么有的onEnterFrame = function () 前面没有实例名称,但是有的必须有呢
就像:
drawViewX();
function drawViewX() {
// wh 单元格长与宽
var wh:Number = 10;
this.createEmptyMovieClip("lineX", this.getNextHighestDepth());
onEnterFrame = function () {
with (lineX) {
lineStyle(1, 0xCCCCCC, 100);
moveTo(0, wh);
lineTo(Stage.width, wh);
}
if (lineX._width>=Stage.width) {
wh += 10;
}
if (wh>=Stage.height) {
delete onEnterFrame;
drawViewY();
}
updateAfterEvent();
};
}
和
var v0:Number = 0;
function drawX() {
this.createEmptyMovieClip("xline", this.getNextHighestDepth());
with (xline) {
lineStyle(1, 0x000000, 100);
moveTo(20, y0);
}
xline.onEnterFrame = function() {
v0 += 20;
this.lineTo(v0, y0);
if (this._width>=Stage.width-40) {
delete this.onEnterFrame;
v0 = 0;
//== 画坐标系的Y轴
drawY();
}
};
}
请各位解释一下我的困惑,在百度搜过了,没有找到答案才来麻烦各位的
谢谢咯