Posted By

scruffpuff on 11/09/11


Tagged


Versions (?)

Checking if a click occurred outside a DisplayObject


 / Published in: ActionScript 3
 

  1. var coords:Point = this.localToGlobal(new Point(this.x, this.y));
  2. trace(stage.mouseX);
  3.  
  4. if (stage.mouseX < coords.x || stage.mouseX > coords.x + this.width || stage.mouseY < coords.y || stage.mouseY > coords.y + this.height)
  5. {
  6. trace(this, "click outside!!!");
  7. }

Report this snippet  

You need to login to post a comment.