PDA

View Full Version : Actionscript and reading xml


siphilp
14-09-2007, 11:32 AM
Ok today I am looking at flash/actionscript and I am having problems reading xml.
xml file is like

<XmlTop>
<Entity>
<name>Simon Philp</name>
<folder>/folder/desktop/</folder>
<image>siphilp.jpg</image>
</Entity>
<Entity>
<name>Simon Philp2</name>
<folder>/folder/desktop2/</folder>
<image>siphilp2.jpg</image>
</Entity>
<Entity>
<name>Simon Philp3</name>
<folder>/folder/desktop3/</folder>
<image>siphilp3.jpg</image>
</Entity>
</XmlTop>

Is there a simple way to loop through the Entity parts?
Everything I have tried brings back undefined

value = childNodes[0].nodeValue;

anyone?

Ben Collier
15-09-2007, 11:06 AM
What actionscript version are you using?

If it's 3 then try http://pixelfumes.blogspot.com/2007/05/easy-xml-parsing-using-as3-actionscript.html

Personally I've never needed to combine XML and flash (yet!), so best of luck!

Ben