电影剪辑没有正确指向鼠标// AS2

时间:2012-08-13 13:20:11

标签: flash actionscript-2

我使用此代码将我的影片剪辑指向鼠标所在的位置,但它没有正确转动。它变得像是转移了。像电影剪辑的中心是错的?有人可以帮帮我吗?

onClipEvent(enterFrame){
   dx = _parent._xmouse-_x;
   dy = _parent._ymouse-_y;
   angle = Math.atan2(dy, dx);
   _rotation = angle * 180/Math.PI;
}

onClipEvent(enterFrame){
   if(Key.isDown(68)){
      this._x += 1.5;
   }
   if(Key.isDown(65)){
      this._x -= 1.5;
   }
   if(Key.isDown(87)){
      this._y -= 1.5;
   }
   if(Key.isDown(83)){
      this._y += 1.5;
   }
}

1 个答案:

答案 0 :(得分:0)

这很可能与你正在处理的MovieClip在其他地方而不是在中心的枢轴点有关。在正在旋转的mc内输入flash,将其放置在质心位于0,0