357
CHAPTER 14
Behaviors
A behavior in Macromedia Director MX is prewritten Lingo script 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 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 your own behaviors by writing Lingo script. 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/support/director/lingo/d8/d8behaviors.html.
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, note that 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 don’t have to include the
Behavior library when you distribute the movie.
Summary of Contents for DIRECTOR MX-USING DIRECTOR MX
Page 1: ...Using Director MX Macromedia Director MX...
Page 12: ...Contents 12...
Page 156: ...Chapter 4 156...
Page 202: ...Chapter 6 202...
Page 244: ...Chapter 7 244...
Page 292: ...Chapter 10 292...
Page 330: ...Chapter 12 330...
Page 356: ...Chapter 13 356...
Page 372: ...Chapter 14 372...
Page 442: ...Chapter 16 442...
Page 472: ...Chapter 18 472...
Page 520: ...Chapter 19 520...
Page 536: ...Chapter 20 536...
Page 562: ...Chapter 23 562...
Page 566: ...Chapter 24 566...
Page 602: ...Chapter 27 602...