User Guide

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 dont 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.