/ Published in: ActionScript 3
URL: http://www.bigspaceship.com/blog/labs/snaring-mouseenabled/
This is a handly little snippet from Big Spaceship. It will show you (on click) what movieclips are under your mouse. This is handy for those times when something is blocking a mouse action and you need to see what is under your mouse.
Expand |
Embed | Plain Text
import flash.geom.Point; stage.addEventListener (MouseEvent.CLICK, _checkMouseEventTrail, false, 0, true); private function _checkMouseEventTrail ($e:MouseEvent):void { var pt:Point = new Point (mouseX, mouseY); var objects:Array = this.getObjectsUnderPoint (pt); for (var i:int = 0; i< objects.length; i++) { trace(">>", objects[i].name,": ",objects[i]); } var p:* = $e.target; while (p) { trace(">>", p.name,": ",p); p = p.parent; } };
Comments
Subscribe to comments
You need to login to post a comment.

fucking excellent snippet. Helped me pinpoint wtf was going on with something that changed my cursor to pointer... thumbs up man!