Events

We've described a computer program as a series of instructions that the computer carries out step-by-step. Some simple computer programs consist of nothing more than that--a few steps which the computer carries out, at which point the program ends. However, ActionScript programs are designed to keep running, waiting for user input or other things to happen. Events are the mechanism that determines which instructions the computer carries out and when.

In essence, events are things that happen that ActionScript is aware of and can respond to. Many events are related to user interaction--like a user clicking a button, or pressing a key on the keyboard--but there are also other types of events. For example, if you use ActionScript to load an external image, there is an event that can let you know when the image has finished loading. In essence, when an ActionScript program is running, Adobe Flash Player just sits and waits for certain things to happen, and when those things happen, it runs the specific ActionScript code that you've specified for those events.

Subtopics

Basic event handling
Examining the event-handling process
Event-handling examples

Flash CS3

Take a survey


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00000020.html