FLASH中this的一个问题

在通常的表达中,在表示相对路径的时候在前面加this和不加this基本上一样的,联知是我没有好好看教程还是FLASH的一个BUG,在
 mousemove = new Object();
 mousemove.onMouseWheel = function(delta) {
  if (滑块._y-delta>滑块.top && 滑块._y<滑块.bottom+delta) {
   滑块._y -= delta;
  } else if (滑块._y>滑块.top && 滑块._y<滑块.bottom&&delta>0) {
   滑块._y -= 1;
  }else if (滑块._y>滑块.top && 滑块._y<滑块.bottom&&delta<0){
   滑块._y -= -1;
   }
 };
//这个是正确的

 Mouse.addListener(mousemove);
 mousemove = new Object();
 mousemove.onMouseWheel = function(delta) {
  if (this.滑块._y-delta>this.滑块.top && 滑块._y<this.滑块.bottom+delta) {
   滑块._y -= delta;
  } else if (this.滑块._y>this.滑块.top && this.滑块._y<this.滑块.bottom&&delta>0) {
   this.滑块._y -= 1;
  }else if (this.滑块._y>this.滑块.top && this.滑块._y<this.滑块.bottom&&delta<0){
   this.滑块._y -= -1;
   }
 };
 Mouse.addListener(mousemove);
//这个是错误的
是不一样的,当然了如果用绝对路径是正确的,如果有知道此区别的告知小弟,我在这里先谢了

posted on 2004-10-12 10:46  软件下载园  阅读(1354)  评论(3编辑  收藏  举报

导航