Writing Scripts with Lingo
389
To open a movie script or parent script for editing:
•
Double-click the script in the Cast window.
To change a script’s type:
1
Select the script in the Cast window or open it in the Script window.
2
Click the Script tab of the Property inspector and select a script type from the Type
pop-up menu.
To cycle through the scripts in the Script window:
•
Use the Previous Cast Member and Next Cast Member arrows at the top of the Script window
to advance or back up to a script.
To duplicate a script:
•
Select the script in the Cast window and select Duplicate from the Edit menu.
To create a script that is attached automatically to every sprite made from a specific cast member,
attach the script to the cast member itself.
To create a script attached to a cast member or open an existing one, do one of the following:
•
Right-click (Windows) or Control-click (Macintosh) on a cast member in the Cast window
and select Cast Member Script from the context menu.
•
Select a cast member in the Cast window and then click the Cast Member Script button in the
Cast window.
Lingo terminology
Like any programming language, Lingo uses specific terminology and has rules of grammar and
punctuation that you must follow. This information is summarized in this section.
Important Lingo terms are listed here in alphabetical order. References are included for terms that
are discussed in more detail elsewhere in this chapter.
Arguments
are placeholders that let you pass values to scripts (see “Using arguments to pass values
to a handler” on page 396). For example, the following handler, called
addThem
, adds two values
it receives in the arguments
a
and
b
.
on addThem a, b
c = a + b
end
Commands
are terms that instruct a movie to do something while the movie is playing. For
example,
go to
sends the playhead to a specific frame, a marker, or another movie.
Constants
are elements that don’t change. For example, the constants
TAB
,
EMPTY
, and
RETURN
always have the same meaning.
Events
are actions that occur while a movie is playing. For example, when a movie stops, a sprite
starts, the playhead enters a frame, or the user types at the keyboard, these actions are events.
Expressions
are any part of a statement that produces a value. For example,
2 + 2
is an
expression.
Содержание 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...