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.
Содержание DIRECTOR MX-USING DIRECTOR MX
Страница 1: ...Using Director MX Macromedia Director MX...
Страница 12: ...Contents 12...
Страница 156: ...Chapter 4 156...
Страница 202: ...Chapter 6 202...
Страница 244: ...Chapter 7 244...
Страница 292: ...Chapter 10 292...
Страница 330: ...Chapter 12 330...
Страница 356: ...Chapter 13 356...
Страница 372: ...Chapter 14 372...
Страница 442: ...Chapter 16 442...
Страница 472: ...Chapter 18 472...
Страница 520: ...Chapter 19 520...
Страница 536: ...Chapter 20 536...
Страница 562: ...Chapter 23 562...
Страница 566: ...Chapter 24 566...
Страница 602: ...Chapter 27 602...