/ Published in: ActionScript 3

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// to rotate 'mc' to point towards 'target'... mc.rotation = Math.atan2(target.x, target.y) * (180 / Math.PI); // if you need the angle in Radians leave off the PI modifier at the end... var angleInRadians = Math.atan2(target.x, target.y);
Comments
