Parameter.insertitem(), Parameter.listindex – Adobe Extending Flash Professional CS5 User Manual
Page 374
352
EXTENDING FLASH PROFESSIONAL
Parameter object
Last updated 5/2/2011
parameter.insertItem()
Availability
Flash MX 2004.
Usage
parameter.insertItem(index, name, value, type)
Parameters
index
A zero-based integer index that indicates where the item will be inserted in the list, object, or array. If the index
is 0, the item is inserted at the beginning of the list. If the index is greater than the list size, the new item is inserted at
the end of the array.
name
A string that specifies the name of the item to insert. This is a required parameter for object parameters.
value
A string that specifies the value of the item to insert.
type
A string that specifies the type of item to insert.
Returns
Nothing.
Description
Method; inserts an item in a list, object, or array. If a parameter is a list, object, or array, the value property is an array.
Example
The following example inserts the value of
New Value
into the
labelPlacement
parameter:
// Select an instance of a Button component on the Stage.
var parms = fl.getDocumentDOM().selection[0].parameters;
parms[2].insertItem(0, "name", "New Value", "String");
var values = parms[2].value;
for(var prop in values){
fl.trace("labelPlacement parameter value = " + values[prop].value);
}
parameter.listIndex
Availability
Flash MX 2004.
Usage
parameter.listIndex
Description
Property; the value of the selected list item. This property is valid only if
parameter.valueType
is
"List"
.