User Guide

Chapter 16398
After a handler intercepts a message, the message doesnt automatically pass on to the remaining
locations. (You can use the
pass command to override this default rule and pass the message to
other objects.) If no matching handler is found after the message passes to all possible locations,
Director ignores the message.
The exact order of objects to which Director sends a message depends on the message. For details
about the sequence of objects to which Director sends specific messages, see the Lingo Dictionary
entry for the message.
Using lists
Lists (called arrays in ActionScript and some other languages) provide an efficient way to track
and update an array of data, such as a series of names or the values assigned to a set of variables.
For example, if you know you will need to keep track of many names or numbers in your Director
project, you may want to store them in a list. The list operator
[ ] designates that the items
within the brackets comprise a list.
You can create two types of lists with Lingo: linear lists and property lists.
In a linear list, each element is a single value. For example, this linear list is a simple set of
numbers:
[100, 150, 300, 350]
In a property list, each element contains two values separated by a colon. One value is a
property name, always preceded by a pound (#) sign; the other value is the value associated
with that property. For example, the following statement sets the variable
myList to a property
list containing values for the properties #speed, #direction, and #weight. These could be the
properties of an asteroid.
myList = [#speed: 155, #direction: 237, #weight: 8746]
Properties can appear more than once in a property list.
Both kinds of lists can be empty, containing no values at all. An empty linear list consists of
two square brackets
[ ]. An empty property list consists of two square brackets surrounding
acolon
[:].
It’s usually easier to manipulate a list by assigning it to a variable when you create the list. The
value contained in the variable is actually a reference to the list, not the list itself.
For more information on lists, see
list() in the Lingo Dictionary.
Creating linear lists
The most common way to create a linear list is to use the list operator (
[ ]). You can also use the
list() function to create a linear list.
To create a linear list, do one of the following:
Place the list elements within the list operator ([ ]).
Specify the lists elements as parameters of the list() function. (This function is useful when
you use a keyboard that doesnt provide square brackets.)
In both cases, you use commas to separate items in the list.