I have this swf that written in AS2
http://www.knowingames.com/test_ik_06.swf
if (stage.mouseX == _lastMouseX && stage.mouseY == _lastMouseY) {
return;
}
var dX:Number = stage.mouseX - _myClip.x;
var dY:Number = -(stage.mouseY - _myClip.y);
var angleRad:Number = - (Math.atan2(dY, dX) + Math.atan2(_offsetX, _offsetY));
_myClip.rotation = angleRad * 180 / Math.PI + 90 ;
//trace(drizzler.rotation);
var dxX:Number = (_offsetX*Math.cos(angleRad) - _offsetY*Math.sin(angleRad));
var dyY:Number = (_offsetX*Math.sin(angleRad) + _offsetY*Math.sin(Math.PI/2 - angleRad));
_myClip.x = stage.mouseX - dxX;
_myClip.y = stage.mouseY - dyY;
_lastMouseX = stage.mouseX;
_lastMouseY = stage.mouseY;
this _offsetX and _offsetY is where you pressing with the mouse
does anyone have idea why it doesn’t working in AS3?
or have an exmple for rotate and drag phisycs