Posted By

arpo on 09/02/09


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

TrentSkunk
davidino1978


Follow mouse Basics


 / Published in: ActionScript 3
 

Add the stage event listener to a function that fires when the stage is ready.

Replace myMC with what ever movieclip you want to move.

  1. stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
  2.  
  3. function mouseMoveHandler(evt:MouseEvent):void
  4. {
  5. myMC.x = evt.stageX;
  6. myMC.y = evt.stageY;
  7. }

Report this snippet  

You need to login to post a comment.