Sinf Pom..can you think of an easier way to do this?

I have this animation. Click on the hand and then its spins around with the mouse, and then if you click again it lets go. I was wondering if there was an easier way that I missed

<embed src=“http://www.angelfire.com/dc/vidgame/tutorials/MoveableHands.swf” height=250 width=250></embed>

here’s the code on the hand…

onClipEvent (load) {
nStop = 0;
}
onClipEvent (enterFrame) {
nXmouse = _root._xmouse-_x;
nYmouse = _root._ymouse-_y;
Radius = Math.sqrt((nXmousenXmouse)+(nYmousenYmouse));
nAngle = Math.asin(nYmouse/Radius);
if (_root._xmouse<_x) {
nRadian = (-nAngle180/Math.PI);
if (nDrag == true) {
_rotation = nRadian-90;
}
} else {
nRadian = (nAngle
180/Math.PI);
if (nDrag == true) {
_rotation = nRadian+90;
}
}
}
onClipEvent (mouseDown) {
if (hitTest(_root._xmouse, _root._ymouse)) {
nDrag = true;
}
}
onClipEvent (mouseUp) {
nStop++;
if (nStop == 2) {
nDrag = false;
nStop = 0;
}
}

try this:
jeremydecker.s5.com/click_point.swf
jeremydecker.s5.com/click_point.fla

fewer lines of code means less to debug!
:slight_smile:
jeremy

well jesus…i guess so…thanks sinf…

edit the movieclip itself then move the bottom part of the hand to the crosshair in the middle. now when you do a _rotation script, it’ll rotate around the bottom part of that hand. you don’t really need all the math.