如果我有一个来自xml:XML的XMLList,FirstLevel:XMLList,那么我可以像这样序列化:
var FirstLivel:XMLList = xml.children();
for(var i in FirstLevel){
我希望每个项目的孩子都这样:
SecondLevel:XMLList = FirstLevel[i].children();
但这不起作用!获得这些孩子的正确方法是什么?
答案 0 :(得分:1)
var firstLevel:XMLList = xml.children();
var secondLevel:Array = [];
for each (var child in firstLevel) {
secondLevel.push(child);
}
trace(secondLevel[0]); // this gets you the first child