9
CHAPTER 2
Director Scripting Essentials
If you are new to scripting in Macromedia Director MX 2004, you may want to take some time
to learn the basic scripting concepts that are essential to understanding how to script in Director
before you begin. Some of these essentials include definitions of important terms, syntax rules,
available data types, and information about the basic elements of scripting in Director—for
example, variables, arrays, operators, and so on.
Types of scripts
A Director movie can contain four types of scripts: behaviors, movie scripts, parent scripts, and
scripts attached to cast members. Behaviors, movie scripts, and parent scripts all appear as
independent cast members in the Cast window. A script attached to a cast member is associated
with that cast member in the Cast window and does not appear independently.
•
Behaviors are scripts that are attached to sprites or frames in the Score, and are referred to as
sprite behaviors or frame behaviors. The Cast window thumbnail for each behavior contains a
behavior icon in the lower right corner.
When used in the
Director Scripting Reference
, the term
behavior
refers to any script that you
attach to a sprite or a frame. This differs from the behaviors that come in the Director Library
Palette. For more information on these behaviors, which are built into Director, see the Using
Director topics in the Director Help Panel.
All behaviors that have been added to a cast library appear in the Behavior inspector’s Behavior
pop-up menu. Other types of scripts do not appear there.
You can attach the same behavior to more than one location in the Score. When you edit a
behavior, the edited version is applied everywhere the behavior is attached in the Score.
•
Movie scripts contain handlers that are available globally, or on a movie level. Event handlers in
a movie script can be called from other scripts in the movie as the movie plays.
A movie script icon appears in the lower right corner of the movie script’s Cast window
thumbnail.
Movie scripts are available to the entire movie, regardless of which frame the movie is in or
which sprites the user is interacting with. When a movie plays in a window or as a linked
movie, a movie script is available only to its own movie.
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...