385
CHAPTER 16
Writing Scripts with Lingo
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.
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 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.
Movie scripts
can respond to events such as key presses, mouse clicks, and your own custom
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.
Содержание 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...