Posted By

arpo on 09/30/09


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

TrentSkunk


Drag layer basics


 / Published in: ActionScript 3
 

  1. private function init():void {
  2. theDragClip.addEventListener( MouseEvent.MOUSE_DOWN, handleStartDrag);
  3. theDragClip.addEventListener( MouseEvent.MOUSE_UP, handleStopDrag);
  4. }
  5.  
  6. private function handleStartDrag(e:MouseEvent) {
  7. //if (e.target == stage) {
  8. theDragClip.startDrag();
  9. stage.addEventListener(MouseEvent.MOUSE_UP, handleStopDrag);
  10. //}
  11. }
  12.  
  13. private function handleStopDrag(e:MouseEvent){
  14. theDragClip.stopDrag();
  15. stage.removeEventListener(MouseEvent.MOUSE_UP, handleStopDrag);
  16. }

Report this snippet  

You need to login to post a comment.