hey all,
I have two combo boxes on my stage both populated with xml. The first one is populated with xml that has values ‘name’ and ‘value’. The names are populating perfectly. However, now i want to be able to load a different xml file when an item in the combo box is selected, which will populate the second combo box. The problem is, i cannot figure out how to pass the value to the xml.load(). My AS so far is below:
var stateXML:XML = new XML();
stateXML.ignoreWhite = true;
stateXML.onLoad = function() {
var howMany:Array = new Array();
howMany = this.firstChild.childNodes;
if (howMany.length>0) {
for (var i:Number = 0; i<howMany.length; i++) {
statecb.addItem(this.firstChild.childNodes*.attributes.name);
}
}
statecb.onSelect = function() {
town_xml = new XML();
town_xml.load(town);
};
};
stateXML.load(“http://www.townfreebies.com/states.xml”);
As you can see, statecb.onSelect is supposed to load ‘town’, which is an xml file name bye ‘value’ in the first xml file. Anyone know how i can do this? I know this will be simple, once i can harness the attribute.value . Sorry if this is confusing.
Thanks all,
Mat