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 = (nAngle180/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;
}
}