The following example shows how you can declare custom events in an MXML or ActionScript component in Flex 4 by specifying the [Event] metadata.
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
According to the Flex 3 documentation for the EventDispatcher class’s
hasEventListener() method (link):
The difference between
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.