Flash ActionScript 3 Adding Event Listeners
In previous tutorial, we learned what is event, how to identify the listerner, and how to given instruction to the listener to response the event. It is time to summarize the whole picture.
To add or create an event listener, we have to:
- Identify the listener who will listen for a specific event.
In previous tutorial, Alex was identified as the listener.
- Choose an event that the listener can know that occur.
Alex was asked to listen to the voice "Alex". There is no reason to ask Alex to listen to extra-sonic voice or see something thousand miles away.
- Instruction how to react to the event when occur.
Alex will raise up his right hand when somebody called "Alex"
The Add Event Listener can be explained with the following diagram:
If the above Add Event Listener is expressed in ActionScript format that we are familair with, this may be like the following diagram:
Up to now, I think you should get some basic idea of the Add Event Listener method. In next tutorial, we will use baic example to illustrate the use of Add Event Listener.