I am trying to extract nodes from an XMLList as follows:
this.txtDebug.appendText("\n\ntmpData Dump:\n");
this.txtDebug.appendText(tmpData.user);
var XMLUsers:XMLList = tmpData.user;
this.txtDebug.appendText("\n\nprinted thorugh for loop:\n");
for (var i:int = 0; i < XMLUsers.length(); i++)
{
this.txtDebug.appendText(XMLUsers[i] + String(i) + "\n");
}
and this is the output I am getting:
tmpData Dump:
<user id="10" score="100"/>
<user id="20" score="200"/>
<user id="30" score="300"/>
<user id="40" score="400"/>
<user id="1000" score="500"/>
printed thorugh for loop:
0
1
2
3
4
I tried with String(XMLUsers[i]) and tried with for each loop, but couldnt get the XMLUsers[i] printed.. Can some1 tell me whats the mistake m doing?
and to get the score attribute I need to write like "XMLUsers[i].@score" right?
thanks :)