Ok here is what I’m trying to do:
I loaded my xml document and that works perfectly but, I’m trying to find out the names of the attributes in my xml document. Can’t flash do this??
I know there is the .attributes property and it returns an associative array (meaning I need to know the names of the properties). I guess this isn’t a big deal since I am authoring the xml document but, it would be useful to be able to loop through the elements like a normal array. Can this be done?
-z
my code:
XML “slides.xml”:
[AS]
<Slides>
<slideNode jpegURL=“images/image1.jpg”>A sea horse</slideNode>
<slideNode jpegURL=“images/image2.jpg”>Sea anemone</slideNode>
<slideNode jpegURL=“images/image3.jpg”>Sardines!</slideNode>
<slideNode jpegURL=“images/image4.jpg”>Another sea horse</slideNode>
<slideNode jpegURL=“images/image5.jpg”>Some kind of jellyfish</slideNode>
</Slides>
[/AS]
Actionscript:
[AS]
slidesXML = new XML();
slidesXML.ignoreWhite = true;
slidesXML.load(“slides.xml”);
slidesXML.onLoad = function(success)
{
if(success)
{
trace(slidesXML.firstChild.firstChild.attributes); //pseudo code (trace=[type Object]
}
}
[/AS]