Lingo, the scripting language of Macromedia Director MX, adds interactivity to a movie. You can
use Lingo to control a movie in response to specific conditions and events. For example, Lingo
can play a sound after a specified amount of the sound has streamed from the Internet.
Scripting basics
The information in this section introduces and explains basic Lingo scripting concepts that
Director uses. If you are new to scripting, review this section before you begin writing scripts
in Lingo.
Types of scripts
Director uses four types of scripts: behaviors, movie scripts, parent scripts, and scripts attached
to cast members. Behaviors, movie scripts, and parent scripts all appear as cast members in the
Cast window.
are scripts that are attached to sprites or frames in the Score, and are referred to as
Behaviors
sprite behaviors or frame behaviors. The Cast window thumbnail for each behavior contains a
behavior icon in the lower right corner.
When used in this chapter, the term "behavior" refers to any Lingo 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 about the behaviors built in to Director, see Chapter 14, "Behaviors,"
on page 357.
All behaviors that have been added to the cast appear in the Behavior inspector's Behavior pop-up
menu. (Other types of scripts don't 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.
can respond to events such as key presses, mouse clicks, and your own custom
Movie scripts
events, and can control what happens when a movie starts, stops, or pauses. 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.
CHAPTER 16
Writing Scripts with Lingo
385
Need help?
Do you have a question about the DIRECTOR MX-USING DIRECTOR MX and is the answer not in the manual?
Questions and answers