MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference page 40

Director scripting reference
Table of Contents

Advertisement

The following statements illustrate defining the linear list
, and then adds
Heather
-- Lingo syntax
workerList = ["Heather"] -- define a linear list
workerList[2] = "Carlos" -- set the second value using the equal operator
workerList.setAt(2, "Carlos") -- set the second value using setAt()
// JavaScript syntax
var workerList = list("Heather"); // define a linear list
workerList[2] = "Carlos"; // set the second value using the equal operator
workerList.setAt(2, "Carlos"); // set the second value using setAt()
To retrieve a value in a linear list:
Use the list variable followed by the number that indicates the value's position in the list. Place
square brackets around the number.
Use the
getAt()
The following statements create the linear list
the list to the variable
-- Lingo syntax
workerList = ["Bruno", "Heather", "Carlos"] -- define a linear list
name2 = workerList[2] -- use bracketed access to retrieve "Heather"
name2 = workerList.getAt(2) -- use getAt() to retrieve "Heather"
// JavaScript syntax
var workerList = list("Bruno", "Heather", "Carlos");
var name2 = workerList[2] // use bracketed access to retrieve "Heather"
var name2 = workerList.getAt(2) // use getAt() to retrieve "Heather"
To set a value in a property list, do one of the following:
Use the equals (=) operator.
In Lingo only, use the
Use dot syntax.
The following Lingo statement uses the equals operator to make
with the property
-- Lingo syntax
foodList = [:] -- define an empty property list
foodList[#Bruno] = "sushi" -- associate sushi with Bruno
The following Lingo statement uses
the property
Bruno
-- Lingo syntax
foodList = [:] -- define an empty property list
foodList.setaProp(#Bruno, "sushi") -- use setaProp()
// JavaScript syntax
foodList = propList() -- define an empty property list
foodList.setaProp("Bruno", "sushi") -- use setaProp()
The following statements use dot syntax to set the value associated with
.
teriyaki
40
Chapter 2: Director Scripting Essentials
as the second value in the list.
Carlos
method.
.
name2
method.
setaProp()
.
Bruno
setaprop()
.
workerList
, and then assign the second value in
workerList
sushi
to make
the new value associated with
sushi
that contains one value,
the new value associated
from
to
Bruno
sushi

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Director mx 2004

Table of Contents