About events and interaction

Whenever a user clicks the mouse or presses a key, an event is generated. These types of events are generally called user events, because they are generated in response to some action by the end user. You can write ActionScript to respond to, or handle, these events. For example, when a user clicks a button, you might want to send the playhead to another frame in the SWF file or load a new web page into the browser.

In a SWF file, buttons, movie clips, and text fields all generate events to which you can respond. ActionScript provides three ways to handle events: event handler methods, event listeners, and on() and onClipEvent() handlers. For more information about events and handling events, see Handling Events.