230
Chapter 12: Methods
add
Usage
-- Lingo syntax
linearList.add(
value
)
// JavaScript syntax
array.push(
value
)
Description
List command; for linear lists only, adds a value to a linear list. For a sorted list, the value is placed
in its proper order. For an unsorted list, the value is added to the end of the list.
This command returns an error when used on a property list.
Note:
Don’t confuse the
add
command with the
+
operator used for addition or the & operator used to
concatenate strings.
Parameters
value
Required. A value to add to the linear list.
Example
These statements add the value 2 to the list named
bids
. The resulting list is [3, 4, 1, 2].
-- Lingo syntax
bids = [3, 4, 1]
bids.add(2)
// JavaScript syntax
bids = new Array(3,4,1);
bids.push(2);
This statement adds 2 to the sorted linear list [1, 4, 5]. The new item remains in alphanumeric
order because the list is sorted.
-- Lingo syntax
bids.add(2)
// JavaScript syntax
bids.push(2);
// to sort the list using JavaScript syntax
bids.sort();
See also
sort
add (3D texture)
Usage
--Lingo syntax
member(
whichCastmember
).model(
whichModel
).meshdeform.mesh[
index
].\
textureLayer.add()
// JavaScript syntax
member(
whichCastmember
).model(
whichModel
).meshdeform.mesh[
index
].\
textureLayer.add()
Summary of Contents for DIRECTOR MX 2004
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...