Chapter 2. Using Event Handlers


It's common knowledge that for every action there is a reaction. In the physical world, things happen around us all the time usually as the result of a specific action. We push buttons, we push people, we even push people's buttons, all with a single purpose: to solicit a response. The Macromedia Flash way of saying this is that for every event there is an action.

In a Flash environment, the responses that come from pushing, holding, moving, entering, leaving, and so on are triggered by event handlers. They represent the first step in getting your movie to do anything interactive which is why a thorough understanding of them is vital.

We'll create several projects in this lesson, including this self-running presentation that uses frame events to provide the user with a hands-free experience.

graphics/02fig01.gif

WHAT YOU WILL LEARN

In this lesson, you will:

  • Learn how event handlers are used in scripts

  • Determine the best event handler for the job

  • Use mouse/button events to control interactivity

  • Add keyboard control to a project

  • Create a self-running presentation using frame events

  • Use clip events to create an interactive project

  • Orchestrate multiple events to accomplish a task

  • Define and use event handler methods

  • Learn about listeners and how to use them

APPROXIMATE TIME

This lesson takes approximately 2 hours to complete.

LESSON FILES

Media Files:

None

Starting Files:

Lesson02/Assets/MouseEvents1.fla

Lesson02/Assets/FrameEvents1.fla

Lesson02/Assets/ClipEvents1.fla

Lesson02/Assets/OrchestratingEvents1.fla

Lesson02/Assets/CarParts1.fla

Completed Projects:

MouseEvents2.fla

FrameEvents2.fla

ClipEvents2.fla

OrchestratingEvents2.fla

CarParts2.fla



Macromedia Flash MX ActionScripting Advanced. Training from the Source
Macromedia Flash MX ActionScripting: Advanced Training from the Source
ISBN: 0201770229
EAN: 2147483647
Year: 2002
Pages: 161

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net