# XML attributes property

**URL:** <https://forum.kirupa.com/t/xml-attributes-property/94432>\
**Category:** Uncategorized\
**Created:** [November 12, 2003, 4:30pm UTC](https://forum.kirupa.com/t/xml-attributes-property/94432 "2003-11-12T16:30:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zerium](https://avatars.discourse-cdn.com/v4/letter/z/85e7bf/32.png) [@zerium](https://forum.kirupa.com/u/zerium)\
**Post date:** [November 12, 2003, 4:30pm UTC](https://forum.kirupa.com/t/xml-attributes-property/94432/1 "2003-11-12T16:30:07Z")

</div>

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]
