
Код AS1/AS2:
clip_mc.onEnterFrame = function() {
if(this._x == _xmouse && this._y == _ymouse){
this.onEnterFrame = null;
// или
// delete this.onEnterFrame;
return;
}
this._x -= (clip_mc._x-_xmouse)/80;
this._y -= (clip_mc._y-_ymouse)/80;
this._rotation=Math.atan2((this._y-this._parent._ymouse),(this._x-this._parent._xmouse))*180/Math.PI;
};