That looks ok.  Debug it.

 

Put the XMLList into its own variable and trace the length().

 

Also, you reference attributes like this:

trace ([EMAIL PROTECTED]);

 

Tracy

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Berthelot
Sent: Friday, January 26, 2007 9:09 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] problem when looping through xml

 

Hi,
Here's the xml:

<root>
<folder folderid="1" label="n0">
<folder folderid="48" label="n1">
<folder folderid="51" label="n11"/>
</folder>
<folder folderid="49" label="n2">
<folder folderid="52" label="n21"/>
</folder>
<folder folderid="50" label="n3">
<folder folderid="54" label="n4"/>
</folder>
</folder>
</root>

a variable of type XML contains the above. Then when i tried to loop 
through all the 'folder' nodes, the loop exits after the first 
iteration:

for each (var s:XML in myXML..folder){
trace (s.reportid);
}

I thought using .. (double dot) allows us to access any node in the 
hierarchy, is that not correct ?

Thanks

 

Reply via email to