xml填充下拉列表

private function readNation():void{
var array:Array = this.tiles.getChildren();
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE,loadNation);
loader.load(new URLRequest("com/tjsoft/index/config/nation.xml"));
for each(var col:DataGridColumn in this.columnArray){
for each(var ck:CheckBox in array){
if(String(col.dataField).toUpperCase()==String(ck.name).toUpperCase()){
ck.selected = true;
}
}
}
}

private function loadNation(e:Event):void{
var load:URLLoader = URLLoader(e.target);
var xml:XML = XML(load.data);
var xmlArray:XML=<root/>;
for each(var areaX:XML in xml.children()){
var node:XML = <node/>;
node.@name = String(areaX.@name);
xmlArray.appendChild(node);
}
this.nation.dataProvider = xmlArray.children();
}

你可能感兴趣的:(xml)