0

如果我有一个来自 xml:XML 的 XMLList,FirstLevel:XMLList,那么我可以像这样序列化:

var FirstLivel:XMLList = xml.children();
for(var i in FirstLevel){

我想要每个项目的孩子,像这样:

SecondLevel:XMLList = FirstLevel[i].children();

但这不起作用!得到这些孩子的正确方法是什么?

4

1 回答 1

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
于 2013-09-02T04:39:57.690 回答