An event listener “listens” for a specific event to happen. Most events involve either the mouse or the keyboard. For example MOUSE_DOWN listens for the left button on the mouse to be pressed.
Event listeners need to be attached to specific objects. A button, the stage or the whole movie are all objects that we can add an event listener to.
Consider this Code:
In this course we are going to primarily deal with Mouse and keyboard events as a way to interact with the user. But there is more to it, for a full description of event handling in ActionScript check out this article.
1. Any displayable object can have an event listener added to it.
2. Event listeners are effective until they are removed using removeEventListener.