XML help needed (CS3, AS2)

See attached file. I need to display the attributes under the price in the descrip text field. The only xml work I have done is where the nodes are all the same lengths. So it’s easy to access the data using your basic for loop. However, the attributes in this xml file may have different lengths. So far I have pushed all the data to Arrays, but now I have no idea how to access the attributes “name” and “value” and associate it to the product. It should make since after looking at the fla.

Any help will be much appreciated =)

Here is the code in case you don’t have CS3.


var cArray = new Array();
var iArray = new Array();
var dArray = new Array();
var pArray = new Array();
var nArray = new Array();
var vArray = new Array();
var z:Number = -1;
var numProd:Number;
descrip_txt.html = true;
//
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(ok) {
    if (ok) {
        var nodes = this.firstChild;
        var header = nodes.firstChild.childNodes;
        header_txt.text = header;
        var products = nodes.childNodes;
        numProd = products.length-2;
        for (i=1; i<products.length; i++) {
            cArray.push(nodes.childNodes*.attributes.category);
            iArray.push(nodes.childNodes*.attributes.image);
            dArray.push(nodes.childNodes*.attributes.detail);
            pArray.push(nodes.childNodes*.childNodes[0].childNodes);
            var attributesLength = nodes.childNodes*.childNodes[1].childNodes.length;
            for (p=0; p<attributesLength; p++) {
                nArray.push(nodes.childNodes*.childNodes[1].childNodes[p].attributes.name);
                vArray.push(nodes.childNodes*.childNodes[1].childNodes[p].attributes.value);
            }
        }
    }
};
//
function fillText() {
    loadImage(iArray[z]);
    cat_txt.text = cArray[z];
    description = "Category = "+cArray[z]+"<br />Price = "+pArray[z]+"<br />";

/* HERE IS WHERE I AM STUCK. I NEED TO SOME HOW PULL THE VALUES FROM nArray AND vArray.  I MAY BE OFF HERE, SO FEEL FREE TO POINT ME IN THE RIGHT DIRECTION*/

    descrip_txt.htmlText = description;
}
//
nextBtn.onRelease = function() {
    if (z<numProd) {
        z++;
    } else {
        z = 0;
    }
    fillText();
};
prevBtn.onRelease = function() {
    if (z != 0) {
        z--;
    } else {
        z = numProd;
    }
    fillText();
};
//
function loadImage(pic) {
    if (pic == undefined) {
        mtClip.loadMovie("noImage.jpg");
    } else {
        mtClip.loadMovie(pic);
    }
    var temp = this.createEmptyMovieClip("tmp", 999);
    temp.onEnterFrame = function() {
        if (mtClip._width>1 && mtClip._height>1) {
            delete temp.onEnterFrame;
            mtClip.onRelease = function() {
                getURL(dArray[z]);
            };
        }
    };
}
//
myXML.load("myXML.xml");