Flash as3 trigger click
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 to开发者_如何学编程p 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?
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.
精彩评论