* 받은 값을 변환해보자.
1. 먼저 변수 선언 하고 .ㅋ
public var myAC:ArrayCollection;
public var requestXMLArray:Array;
2. 함수 호출하고.
requestXMLArray = ExternalInterface.call(jscall);
myAC = XmlToArrayCollection(new XML(requestXMLArray[0]).result);
3. 아래 부분은 함수 내용임돠 .ㅋ
private function XmlToArrayCollection(xml:XMLList):ArrayCollection{
var result:ArrayCollection = new ArrayCollection();
var xmlLength:int = xml.length();
for(var i:int = 0; i < xmlLength; i++){
var attNamesList:XMLList = xml[i].attributes();
var attrowChildLength:int = xml[i].attributes().length();
for (var k:int = 0; k < attrowChildLength; k++)
{
xml[i].appendChild("<"+attNamesList[k].name()+">"+attNamesList[k]+"</"+attNamesList[k].name()+">");
}
var row:XMLList = xml[i].children();
var rowChildLength:int = row.length();
var resultRow:Object = {};
for(var j:int = 0 ; j < rowChildLength; j++){
if(row[j]=="") {
resultRow[row[j].name()] = "";
} else {
resultRow[row[j].name()] = row[j];
}
}
result.addItem(resultRow);
}
//Alert.show(String(ObjectUtil.toString(result)));
return result;
}