The example below shows the working of the addEventListener
method . As
the name suggests, the method adds events in flex components. Here in the example
only mouse event is added in the components, so whenever a mouse click
occurs on the components in which the events are added, an alert pop up window
comes with some messages coded on it. Event listeners are the methods or
functions in which events are added on the flex components or it can be
said as event listeners handles the event that's why they are also
called event handlers. Here in the example we have two event
listener Handler and Handler1 respectively.
With addEventListener method events can be added onto the components
indirectly inside the scripting tags, through the components id
attribute
or directly by defining in the mxml tag through click and initialize
attributes or properties of the flex components.
Listener.mxml
<?xml version="1.0" encoding = 'utf-8'?>
|
Listener.swf

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Flex Add Event Listener example
Post your Comment