Orient an object to the mouse cursor

How to orient an objet to an other ?
Just put those lines and change the instance name myTank.

// This object will always look at the mouse cursor
myTank.addEventListener(Event.ENTER_FRAME, tankEnterFrame);
// This function will be launched every frame (25 times by seconds)
function tankEnterFrame(pEvt) {
// pEvt.currentTarget : myTank
var mc=pEvt.currentTarget;
// Get the radian [...]

Posted on January 9, 2010 at 18:17 by admin · Permalink · Leave a comment
In: ActionScript, tutorial · Tagged with: , ,