Hello,

I'm parsing following XML:

var lobby:XML =
  <lobby>
    <info>
      <id>DE2</id>
      <name>Alex</name>
      <avatar>2_1211369175.jpg</avatar>
    </info>
    <info>
      <id>DE55</id>
      <name>Vasja</name>
      <avatar>55_1232308551.jpg</avatar>
    </info>
  </lobby>;

var _people:Array = new Array();

setLobby(lobby.info);

function setLobby(list:XMLList):void {
        for each (var info in list) {
                var item:Object = {label: info.name, userid: info.id};
                _people.push(item);
        }
}

- but when I look in the debugger at the elements
of the _people array, then I see that "label" and
"userid" members are of type XMLList and not String.

And that is why my string comparisions later in the code do not work.

Am I supposed to call toString() explicitly:

                var item:Object = {label: info.name.toString(), userid: 
info.id.toString()};

or is there a more natural way?

Thank you
Alex
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to