I'm trying to loop through an XMLList and rather than giving me each item in the list as XML, it's just coming back with the positions as strings e.g.
var myList:XMLList = ... (contains <Animal><Type>Dog</Type></Animal><Animal><Type>Cat</Type></Animal>)
for(var item in myList) {
Alert.show(item);
}
It just alerts "0" or "1". If I inspect the 'item' variable, I see the same thing. But if I inspect 'myList' it looks like the XML.
I've also tried myList.children() and strongly typing 'items' to 'XML' but nothing I do has worked.
Would really appreciate it if someone can tell me the right way to do it.
Thanks
Try
for each
instead offor