Skip to main content
Known Participant
June 21, 2009
Question

XML and flash help...

  • June 21, 2009
  • 2 replies
  • 438 views

Ok I send the socket server info telling it that I joined the room...

And as an example it sends this back to me:

<room name="Playroom">

<player name="someblueguy" value="X.52,Y.21" />

<player name="javageek1212" value="X.23,Y.34" />

</room>

Ok how do I turn name contained in the player node into a string and the value containing the X and Y?

-javageek

This topic has been closed for replies.

2 replies

kglad
Community Expert
Community Expert
June 22, 2009

var playerA:Array = [];

yourxml.onLoad=parseXML;

function parseXML(){

for(var i=0;i<this.firstChild.childNodes.length;i++){

playerA.push({name:this.firstChild.childNodes.attributes.name,value:this.firstChild.childNodes.value});

}

Known Participant
June 21, 2009

bump

Known Participant
June 21, 2009

bump