EasyManua.ls Logo

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING - Page 527

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING
1130 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
setAt 527
• The setaProp command can also set ancestor properties.
Parameters
listProperty
Required. A symbol (Lingo only) or a string that specifies the name of the
property whose value is changing.
newValue Required. The new value for the listProperty property.
Example
These statements create a property list and then adds the item #c:10 to the list:
newList = [#a:1, #b:5]
put newList
-- [#a:1, #b:5]
setaProp newList, #c, 10
put newList
Using the dot operator, you can alter the property value of a property already in a list without
using
setaProp:
newList = [#a:1, #b:5]
put newList
-- [#a:1, #b:5]
newList.b = 99
put newList
-- [#a:1, #b:99]
Note: To use the dot operator to manipulate a property, the property must already exist in the list,
child object, or behavior.
See also
ancestor, property, . (dot operator)
setAt
Usage
setAt list, orderNumber, value
list[orderNumber] = value
Description
Command; replaces the item specified by orderNumber with the value specified by value in the
list specified by list. When orderNumber is greater than the number of items in a property list,
the
setAt command returns a script error. When orderNumber is greater than the number of
items in a linear list, Director expands the list’s blank entries to provide the number of places
specified by
orderNumber.
Example
This handler assigns a name to the list [12, 34, 6, 7, 45], replaces the fourth item in the list with
the value 10, and then displays the result in the Message window:
on enterFrame
set vNumbers = [12, 34, 6, 7, 45]
setAt vnumbers, 4, 10
put vNumbers
end enterFrame