The following example shows how you can check whether a Flex Button control is listening for a specific event (FlexEvent.BUTTON_DOWN) by using the hasEventListener() and willTrigger() methods.
According to the Flex 3 documentation for the EventDispatcher class’s hasEventListener() method (link):
The difference between
hasEventListener()andwillTrigger()is thathasEventListener()examines only the object to which it belongs, whereaswillTrigger()examines the entire event flow for the event specified by the type parameter.
Full code after the jump.
{ 0 comments }
