Make a window target


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. var self:DisplayObject = this;
  2. this.addEventListener(MouseEvent.MOUSE_DOWN, function(event:Event):void{
  3. if(event.target == self){
  4. self.startDrag();
  5. self.addEventListener(MouseEvent.MOUSE_UP, function(event:Event):void{
  6. self.removeEventListener(MouseEvent.MOUSE_UP, arguments.callee);
  7. self.stopDrag();
  8. });
  9. }
  10. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.