User Guide
Chapter 16390
Functions
are terms that return a value. For example, the date() function returns the current
date set in the computer. The
key() function returns the key that was pressed last. Parentheses
occur at the end of a function.
Handlers are sets of Lingo statements within a script that run when a specific event occurs in a
movie (see “Using handlers” on page 396). For example, the following statements comprise a
handler that plays a beep sound when the mouse button is clicked:
on mouseDown
beep
end
Keywords are reserved words that have a special meaning. For example, end indicates the end of a
handler.
Lists are ordered sets of values used to track and update an array of data, such as a series of names
or the values assigned to a set of variables (see “Using lists” on page 398). A simple example is a
list of numbers such as
[1, 4, 2].
Messages are notices that Director sends to scripts when specific events occur in a movie (see
“Using messages to identify events” on page 394). For example, when the playhead enters a
specific frame, the
enterFrame event occurs and Directors sends an enterFrame message. If a
script contains an
on enterFrame handler, the statements within that handler will run, because
the handler received the enterFrame message.
Operators are terms that calculate a new value from one or more values. For example, the addition
(+) operator adds two or more values together to produce a new value.
Properties are attributes that define an object. For example, picture is a property of a bitmap
cast member.
Statements are valid instructions that Director can execute (see “Writing Lingo statements”
on page 392). For example, go to frame 23 is a statement.
Variables are elements used to store and update values (see “Storing and updating values in
variables” on page 402). To assign values to variables or change the values of many properties, you
use the equals (
=) operator or the set command. For example, the statement set startValue =
0
places a value of 0 into a variable named startValue.
Lingo syntax
Lingo supports a variety of data types, including references to sprites and cast members, TRUE and
FALSE or 1 and 0 (Boolean) values, strings, constants, integers, floating-point numbers, points,
rects, colors, and dates.
The following are general syntax rules that apply to all Lingo. Most Lingo terms also have their
own individual requirements about terms that they must be combined with. For the rules for a
specific Lingo term, see the term’s syntax in the Lingo Dictionary.
Parentheses
Functions that return values require parentheses. When you define functions in handlers, you
need to include parentheses in the calling statement.
Use parentheses after the keyword
sprite or member to refer to the object’s identifier: for
example,
member("Patrice Lumumba") refers to the member named Patrice Lumumba.