有问题的 XMLListCollection 被称为 studentsAll 并且在创建后看起来像这样......
<details>
<name>Baughman, John D (@hawaii.rr.com at Pearl City H. S.)</name>
<id>2693</id>
<emailpw>johnbdh@hawaii.rr.com</emailpw>
<pw/>
</details>
<details>
<name>Benoit, Sandra (@gmail.com at Pearl City H. S.)</name>
<id>2694</id>
<emailpw>sandra@gmail.com</emailpw>
<pw/>
</details>
然后我在跑步...
studentsList = new XMLListCollection;
studentsIDs = new XMLListCollection;
for (var _index:int=0; _index < studentsAll.length; _index++) {
studentsList.addItemAt(studentsAll[_index].name, studentsList.length);
studentsIDs.addItemAt(studentsAll[_index].id, studentsIDs.length);
}
完成 XMLListCollection studentsAll 的 Wehn 看起来像这样......
<details>
<name>Baughman, John D (@hawaii.rr.com at Pearl City H. S.)</name>
<name>Benoit, Sandra (@gmail.com at Pearl City H. S.)</name>
<id>2693</id>
<id>2694</id>
<emailpw>johnbdh@hawaii.rr.com</emailpw>
<pw/>
</details>
<details>
<name>Benoit, Sandra (@gmail.com at Pearl City H. S.)</name>
<id>2694</id>
<emailpw>sandra@gmail.com</emailpw>
<pw/>
</details>
注意第二个索引中的标签在第一个索引中是如何重复的。
这是一个错误吗?
谢谢,
约翰