236
Chapter 12: Methods
// JavaScript syntax
t1 = member("Scene").newTexture("Rough", symbol("fromCastMember"),\
member("Cedar"));
sprite(5).camera.addOverlay(t1, point(220, 220), 0);
member("Scene").camera[1].addOverlay(t1, point(20, 20), 45);
See also
removeOverlay
addProp
Usage
list.addProp(
property
,
value
)
addProp
list
,
property
,
value
Description
Property list command; for property lists only, adds a specified property and its value to a
property list.
For an unsorted list, the value is added to the end of the list. For a sorted list, the value is placed in
its proper order.
If the property already exists in the list, both Lingo and JavaScript syntax create a duplicate
property. You can avoid duplicate properties by using the
setaProp()
command to change the
new entry’s property.
This command returns an error when used with a linear list.
Parameters
property
Required. The property to add to the list.
value
Required. The value of the property to add to the list.
Example
This statement adds the property named
kayne
and its assigned value 3 to the property list
named
bids
, which contains [#gee: 4, #ohasi: 1]. Because the list is sorted, the new entry is
placed in alphabetical order:
bids.addProp(#kayne, 3)
The result is the list [#gee: 4, #kayne: 3, #ohasi: 1].
This statement adds the entry
kayne: 7
to the list named
bids
, which now contains [#gee: 4,
#kayne: 3, #ohasi: 1]. Because the list already contains the property
kayne
, Lingo creates a
duplicate property:
bids.addProp(#kayne, 7)
The result is the list [#gee: 4, #kayne: 3, #kayne: 7, #ohasi: 1].
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...