Extending Flash |
|
|
|
| Objects > XMLUI object > xmlui.setControlItemElements() | |||
Flash 8.
xmlui.setControlItemElements(controlID,elementItemArray)
controlID A string that specifies the ID attribute of the control you want to set.
elementItemArray An array of JavaScript objects, where each object has a string property named label and an optional string property named value. If the value property does not exist, then it is created and assigned the same value as label.
Nothing.
Method; clears the values of the ListBox or ComboBox control specified by controlID and replaces the list or menu items with the label, value pairs specified by elementItemArray.
The following example sets the label and value of items in the control with the ID attribute myControlID to the label, value pairs specified:
var nameArray = new Array("January", "February", "March");
var monthArray = new Array();
for (i=0;i<nameArray.length;i++){
elem = new Object();
elem.label = nameArray[i];
elem.value = i;
monthArray[i] = elem;
}
fl.xmlui.setControlItemElements("myControlID", monthArray);
xmlui.getControlItemElement(), xmlui.set(), xmlui.setControlItemElement()
|
|
|
|