Using Director > Writing Scripts with Lingo > Lingo terminology |
![]() ![]() ![]() |
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). 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 playback head 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 playback head 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.
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). For example, the following statements comprise a handler that plays a beep sound when the mouse 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). 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). For example, when the playback head 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). 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). 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
.
![]() ![]() ![]() |