ActionScript®: Your visual blueprint™ for creating interactive projects in Flash® CS4 Professional
by Rob Huddleston
Chapter 7. Create an Event Handler
ActionScript is an event-driven language. This means that in order for anything to occur in your script, an event must be triggered by Flash Player. Events can be triggered by the system or by the user. Examples of system events include an external file finishing being loaded or the play head entering a frame. User-triggered events include the user moving his or her mouse, clicking the mouse button, or pressing a key on the keyboard.
You need two pieces in your code to deal with events: an event handler and an event listener. An event handler is nothing more than a function that describes what will occur when the event is triggered. Event handlers can calculate a total, increase a user's score, submit information ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access