Hi, I am trying to make a small movieclip that rotate itself based on the mouse coordinates while pressed. But the problem is, using the Math.sin function, when I pass the result to angle it won´t go to far than 50 degrees where it should be 90. What´s the matter?
My code
on(press){
isActing = True;
}
onClipEvent(enterFrame){
if (isActing == True){
//This is to get the real coordinates based on the movieclip position
tx = _root._xmouse - this._x;
ty = - (_root.ymouse - this._y); // y is inverted in flash
hyp = Math.sqrt(tx*tx + ty*ty);
sin = Math.sin(ty/hyp);
angle = 180 * sin / Math.PI;
}
}
I was planing to get a base angle and the current mouse angle and then subtract they by rotating the movieclip. But so I´ve got the angle problem. How do I fix it??
Thx, Scooterman