views:

29

answers:

1

So I am working on a project in which I need to trigger a click event. However, its a little more complicated then just that. I know how to dispatch an event by doing btn.dispatchEvent(), but the problem is I dont know which button it will be. Basically I am creating a wheel that spins. I need to trigger the click event of the element that is at the top and center of the wheel when it stops spinning. Is it possible to trigger a click event at a point? Is there a better way to do this?

+1  A: 

Defined in flash.display.DisplayObjectContainer

stage.getObjectsUnderPoint(new Point(x, y));

Or some other display object.

Returns an array of objects that lie under the specified point and are children (or grandchildren, and so on) of this DisplayObjectContainer instance. Any child objects that are inaccessible for security reasons are omitted from the returned array. To determine whether this security restriction affects the returned array, call the areInaccessibleObjectsUnderPoint() method.

Tegeril
Thanks for the help. Works great.
ngreenwood6
No problem at all.
Tegeril