发新话题
打印

[求救] onEnterFrame = function () 的一个问题

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();
  }
};
}

请各位解释一下我的困惑,在百度搜过了,没有找到答案才来麻烦各位的
谢谢咯

TOP

onEnterFrame是MC具有的方法。
前面没有写实例名,就是指当前代码所在的时间轴的属主MC。默认的。
写了,就是指 写的实例名这个MC的onEnterFrame方法

TOP

哦,谢谢版主哈
大概听明白了

TOP

发新话题