# XML data into an array - Need Help!

**URL:** <https://forum.kirupa.com/t/xml-data-into-an-array-need-help/181215>\
**Category:** Uncategorized\
**Created:** [March 7, 2006, 12:51pm UTC](https://forum.kirupa.com/t/xml-data-into-an-array-need-help/181215 "2006-03-07T12:51:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthewjumps](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@matthewjumps](https://forum.kirupa.com/u/matthewjumps)\
**Post date:** [March 7, 2006, 12:51pm UTC](https://forum.kirupa.com/t/xml-data-into-an-array-need-help/181215/1 "2006-03-07T12:51:38Z")

</div>

This is the meat of my XML file

```auto

<panoramic startfirst="true">

            <image>pic_1.jpg</image>

            <title><![CDATA[Pan 1]]></title>

            <content><![CDATA[pan 1 content]]></content>

            <copyright><![CDATA[copyright]]></copyright>

</panoramic>

```

these nodes will be populated from a database. so there could be one, there could be a hundred.

What i am unsure of is what is the best way to extract this from the XML and put it into a usable flash variables form so that i can get the data for any particular node using only an id?

i have my for loop set up, and i know how to access the data … i just dont know what to put it in! A multidimensional array? A class (i have no idea about that)? An object?

heres the loop i have set up it shows how i access the XML…

```auto

for (i=0; i<this.firstChild.firstChild.childNodes.length; i++) {
            //
            image_var = this.firstChild.firstChild.childNodes*.childNodes[0].firstChild.nodeValue;
            page_title = this.firstChild.firstChild.childNodes*.childNodes[1].firstChild.nodeValue;
            page_content = this.firstChild.firstChild.childNodes*.childNodes[2].firstChild.nodeValue;
            page_copyright = this.firstChild.firstChild.childNodes*.childNodes[3].firstChild.nodeValue;
            //
        }

```

so as u can see that accessess the values from all the nodes, but just keeps setting the same 4 vars to the current nodes value …

anyone who could help me i hope understands :pa:
