Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Events are sent to listeners. Functions or objects can be event listeners. When an event occurs, the listener is called by a table representing the event. All events will have a property name that identifies the kind of event.
Display objects and global Runtime objects can be event listeners. You can add and remove listeners for events using the following object methods:
object:addEventListener( ): It adds a listener to the object's list of listeners. When the named event occurs, the listener will be invoked and be supplied with a table representing the event.object:removeEventListener( ): It removes the specified listener from the object's list of listeners so that it no longer is notified of events corresponding to the specified event.