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.
- 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;
CommentsSubscribe to comments
You need to login to post a comment.