User Guide

Scripting terminology 11
Handlers, or event handlers, are sets of statements within a script that run in response to a
specific event and subsequent message. When an event occurs, Director generates and sends
a corresponding message to scripts, and a corresponding handler runs in response to the
message. The names of handlers are always the same as the events and messages they
respond to.
Note: Although in JavaScript syntax an event is actually handled by a function, the term handler is
used generically throughout this reference to refer to both Lingo handlers and JavaScript syntax
functions that handle events.
For more information on handlers, see “Handlers” on page 35.
Keywords are reserved words that have a special meaning. For example, in Lingo, the keyword
end indicates the end of a handler. In JavaScript syntax, the keyword var indicates that the
term following it is a variable.
Lists (Lingo) or Arrays (JavaScript syntax) 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. A simple
example is a list of numbers such as
[1, 4, 2].
For more information on using lists in both Lingo and JavaScript syntax, see “Linear lists and
property lists” on page 38.
For more information on using JavaScript syntax arrays, see “JavaScript syntax arrays”
on page 45.
Messages are notices that Director sends to scripts when specific events occur in a movie. For
example, when the playhead enters a specific frame, the
enterFrame event occurs and
Directors sends an
enterFrame message. If a script contains an enterFrame handler, the
statements within that handler will run, because the handler received the
enterFrame message.
If no scripts contain a handler for a message, the message is ignored in script.
For more information on messages, see “Messages” on page 34
Methods are terms that either instruct a movie to do something while the movie is playing or
return a value, and are called from an object. For example, you would call the
insertFrame()
method from the Movie object, using the syntax
_movie.insertFrame(). Although similar in
functionality to top-level functions, methods are always called from an object, and top-level
functions are not.
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.
For more information on operators, see “Operators” on page 25.
Parameters are placeholders that let you pass values to scripts. Parameters only apply to
methods and event handlers, and not to properties. They are required by some methods and
optional for others.
For example, the Movie object’s
go() method sends the playhead to specific frame, and
optionally specifies the name of the movie that frame is in. To perform this task, the
go()
method requires at least one parameter, and allows for a second parameter. The first required
parameter specifies what frame to send the playhead to, and the second optional parameter
specifies what movie the frame is in. Because the first parameter is required, a script error will
result if it is not present when the
go() method is called. Because the second parameter is
optional, the method will perform its task even if the parameter is not present.