PROBLEM RESOLVED I must be burnt out or something. Didn't take me very long to realize I should just addItem and forget the array.
------------------------------------------------
Objective: Populate a combo box with ceratin data found within an xml object. Combo box should display 2 out of 5 team names.
Work So Far: I figured I could create an array(teamArray) to send to the combo box(chooseTeam) by loop-filtering through my xml object for '...attributes.full = 0' and filling the array thusly.
It works, but my combo box displays 5 "entries", 3 of which are blank, 2 of which are the desired content.
Is there an easy way to fix this or do I need to utilize a new method for populating the combo box?
PHP Code:
teamArray = new Array();
for (i=0; i<_root.numTeams; i++) {
if (_root.teamInfo_xml.firstChild.childNodes[i].attributes.full == 0) {
var myItem = new Object();
myItem.label = _root.teamInfo_xml.firstChild.childNodes[i].attributes.name;
myItem.data = _root.teamInfo_xml.firstChild.childNodes[i].attributes.pass;
teamArray[i] = myItem;
//trace(teamArray);
}
}
this.chooseTeam.setDataProvider(teamArray);