thanton3

07-11-2002, 10:53 AM

Hello

I have a MC that is just a line, there is another MC in that with these object actions:

onClipEvent(load){

var r = 150;

}

onClipEvent(enterFrame){

var angleTarget = 0;

if (Math.pow(_xmouse, 2) + Math.pow(_ymouse, 2) <= Math.pow(r,2)){

angleTarget = Math.atan2(this._ymouse, this._xmouse) ;//* 180/Math.PI;

}

this._parent._rotation = angleTarget * 180/Math.PI;

trace(angleTarget * 180/Math.PI);

}

I think that's all I should need, I just want the line to point at the mouse if the mouse is within a certain radius... the IF works fine, but setting the rotation is screwy, it flips from an almost correct angle to 0.

Anywone know why?

(btw this isn't really my first post here, I just changed emails and forgot my password. Please don't ignore my question based on the fact that it appears I haven't answered any other posts yet :•))

I have a MC that is just a line, there is another MC in that with these object actions:

onClipEvent(load){

var r = 150;

}

onClipEvent(enterFrame){

var angleTarget = 0;

if (Math.pow(_xmouse, 2) + Math.pow(_ymouse, 2) <= Math.pow(r,2)){

angleTarget = Math.atan2(this._ymouse, this._xmouse) ;//* 180/Math.PI;

}

this._parent._rotation = angleTarget * 180/Math.PI;

trace(angleTarget * 180/Math.PI);

}

I think that's all I should need, I just want the line to point at the mouse if the mouse is within a certain radius... the IF works fine, but setting the rotation is screwy, it flips from an almost correct angle to 0.

Anywone know why?

(btw this isn't really my first post here, I just changed emails and forgot my password. Please don't ignore my question based on the fact that it appears I haven't answered any other posts yet :•))