Tag Archives: addEventListener()

Determining if an item is listening for a specific event

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() and willTrigger() is that hasEventListener() examines only the object to which it belongs, whereas willTrigger() examines the entire event flow for the event specified by the type parameter.

Full code after the jump.

Continue reading Determining if an item is listening for a specific event