Get DisplayObject under Point

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

This can be a point you define or a mouse cursor etc.

Copy this code and paste it in your HTML
  1. // Any DisplayObjectContainer (such as a MovieClip or the stage) has a method called
  2. // getObjectsUnderPoint that returns an array of display objects under that point. It takes a // Point object as an argument.
  4. var myObjects: Array = stage.getObjectsUnderPoint(new Point(5, 5));
  6. // If you are using it in a class don't forget to import flash.geom.Point;

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.