O'Reilly logo

Master Visually®: Dreamweaver® CS4 and Flash® CS4 Professional by Rob Huddleston

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 34. Use ActionScript in Your Movie

Create Event Handlers and Listeners

No code in ActionScript can execute without an event occurring. Events include the playhead entering a frame; a MovieClip or other object being created; external data being loaded; or the user interacting with the movie by moving their mouse, clicking on something, or typing a key on the keyboard.

At any given time, there may be hundreds of events occurring in the movie, but they are all ignored unless you write code for them. Code to control events has two parts: an event handler and an event listener.

An event handler is a function that you create to respond to the event. The event handler always takes an argument, which is the event itself, and never returns a value. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required