flash - How to get node value from this xml? -



use actionscript 2.0. need time string simple xml:

<?xml version="1.0" encoding="utf-8"?>   <root>     <time>       2011,01,25,10,58,02     </time>   </root> 

i used

trace(_myxml.firstchild.firstchild.nodevalue); trace(_myxml.firstchild.firstchild[0].nodevalue); trace(_myxml.firstchild.nodevalue); 

but returns ever undefined...

what's wrong?

is there way access xml like: _myxml.root.time.value ?

thanks.

try this

var xmldata:xml = new xml();     xmldata.ignorewhite = true;     xmldata.load("nomeofyourxml.xml");  xmldata.onload = function():void  {     qtd = this.childnodes[0].childnodes.length;     trace(qtd)     (i=0; i<qtd; i++) {         _xml = this.childnodes[0].childnodes[0].childnodes;         trace(_xml);     } } 

my trace result is: (2011,01,25,10,58,02)


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -