
275
CHAPTER 12
Behaviors
A behavior in Macromedia Director MX 2004 is prewritten Lingo or JavaScript syntax that you
use to provide interactivity and add interesting effects to your movie. You drag a behavior from
the Library palette and drop it on a sprite or frame to attach it.
If the behavior includes parameters, a dialog box appears that lets you define those parameters.
For example, most navigation behaviors let you specify a frame to jump to. You can attach the
same behavior to as many sprites or frames as necessary and use different parameters for each
instance of the behavior.
Most behaviors respond to simple events such as a mouse click on a sprite or the entry of the
playhead into a frame. When the event occurs, the behavior performs an action, such as jumping
to a different frame or playing a sound.
Director comes packaged with customizable, reusable behaviors for many basic functions; you
and other developers can also create and share your own behaviors by writing Lingo or JavaScript
syntax. To modify behaviors, you use the Behavior inspector or Property inspector.
For more information about using included behaviors, see Using Director Behaviors on the
Director Support Center at
www.macromedia.com/go/director_behaviors_en
.
Attaching behaviors
You use the Library palette to display behaviors included in Director.
Director allows you to attach the same behavior to several sprites or several frames at the same
time. You can attach as many behaviors as you want to a sprite, but you can attach only one
behavior to a frame. If you attach a behavior to a frame that already has a behavior, the new
behavior replaces the old one. Behaviors attached to frames are best suited to actions that affect
the entire movie. For example, you might attach
Loop Until Media in Frame is Available
to make the movie wait while the media for a particular frame downloads.
When you attach a behavior, and the Parameters dialog box appears, the parameters you specify
apply to the behavior only as it is attached to the current sprite or frame. These settings do not
affect the way the behavior works when attached elsewhere. Use the Behavior inspector to change
parameters for behaviors attached to sprites or frames.
Once you attach a behavior to a sprite or frame, Director copies the behavior from the Behavior
library to the currently selected cast in the movie. This means you do not have to include the
Behavior library when you distribute the movie.
Summary of Contents for DIRECTOR MX 2004-USING DIRECTOR
Page 1: ...DIRECTOR MX 2004 Using Director...
Page 16: ...16 Chapter 1 Introduction...
Page 82: ...82 Chapter 3 Sprites...
Page 98: ...98 Chapter 4 Animation...
Page 134: ...134 Chapter 5 Bitmaps...
Page 242: ...242 Chapter 10 Sound and Synchronization...
Page 274: ...274 Chapter 11 Using Digital Video...
Page 290: ...290 Chapter 12 Behaviors...
Page 302: ...302 Chapter 13 Navigation and User Interaction...
Page 334: ...334 Chapter 15 The 3D Cast Member 3D Text and 3D Behaviors...
Page 392: ...392 Chapter 16 Working with Models and Model Resources...
Page 418: ...418 Chapter 18 Movies in a Window...
Page 446: ...446 Chapter 22 Managing and Testing Director Projects...