Incrementing within arrays using XML data

I’m working with a gallery grabbing images from data extracted from an external XML file, and I’m trying to make it work in a hierarchical or folder like structure in Flash 8. For instance, thumbnails are displayed on load, and when a thumbnail is clicked, more thumbnails specific to the image clicked are displayed. As sort of a beginner to Flash and ActionScript, I’ve been working with this project for a couple months.

There is one obstacle I’m facing within the ‘for’ loops I’m using. First, an example of my XML file is like this:

<art>
    <imageName>images/art01_main.jpg</imageName>
    <thumbName>images/art01_thumb.jpg</thumbName>
    <fullName>images/art01_full.jpg</fullName>
    <description>This is a description for Art 01.</description>
        <products>
            <prod>
                <imageName>products/prod01_main.jpg</imageName>
                <thumbName>products/prod01_thumb.jpg</thumbName>
                <fullName>products/prod01_full.jpg</fullName>
                <description>Product 01</description>
            </prod>
            <prod>
                <imageName>products/prod02_main.jpg</imageName>
                <thumbName>products/prod02_thumb.jpg</thumbName>
                <fullName>products/prod02_full.jpg</fullName>
                <description>Product 02</description>
            </prod>
            <prod>
                <imageName>products/prod03_main.jpg</imageName>
                <thumbName>products/prod03_thumb.jpg</thumbName>
                <fullName>products/prod03_full.jpg</fullName>
                <description>Product 03</description>
            </prod>
        </products>    
</art>

As you may be able to tell, it’s basically a catalog type of organization. I have the ‘art’ images displayed as I need them, but my problem is making the ‘products’ images work.

My ActionScript extracting the products images looks like this:

numOfProd = this.firstChild.childNodes[4].childNodes.length;
    for (j=1; j<=numOfProd; j++) {
        prodImageURL[j]=this.childNodes[0].childNodes[4].childNodes[j-1].childNodes[0].childNodes[0].nodeValue;
        prodThumbURL[j]=this.childNodes[0].childNodes[4].childNodes[j-1].childNodes[1].childNodes[0].nodeValue;
        prodFullURL[j]=this.childNodes[0].childNodes[4].childNodes[j-1].childNodes[2].childNodes[0].nodeValue;
        prodDes[j]=this.childNodes[0].childNodes[4].childNodes[j-1].childNodes[3].childNodes[0].nodeValue;
    }

This way displays the catalog look just as I’d like, but it is only good for the first piece of art since this ‘for’ loop only loops through the <products> node within the first <art> node. Now, if I change ‘this.childNodes[0]’ to ‘this.childNodes[1]’, I can display the <products> for the next <art> node.

The part that I have not been able to figure out is how to increment that ‘this.childNodes[x]’ so that I can use it in an onRelease function. I know this is an awful lot of info for a post, but I couldn’t see any other way to attempt to clearly ask this question. Any help would be greatly appreciated as I’ve searched for quite awhile to no avail. I can provide an .fla if it would help to find the magic code. THANKS!