Two Imagesat a time using same XML

Hello all you happy people,

I have been trying to show two images (no problem) from the same xml file in a gallery using two MC’s like a book. I would like to be able to use back and fwd buttons to page through them with the left page being page 1 and the right being page 2 and if you click the fwd button the images change to page 3 and page 4. I have been somewhat successful but of course I run into trouble when we have to use the back button at the start and the fwd button and the end of the array.

Here is the bit of code I have been working with from the “resize_height” gallery which I have modified rather hastily to my needs (thanks everyone!)

        //loading first picture
        containerMC_2.loadPic(1);
        containerMC.loadPic(0);
        
    } else {
        title_txt.text = "Error!";
    }
};
gallery_xml.load("gallery.xml");
prevb.onRelease = function() {
    cur--;
    if (cur<0) {
        containerMC.loadPic(pArray.length-1);
        containerMC_2.loadPic(pArray.length-1);
    } else {
        containerMC.loadPic(cur);
        containerMC_2.loadPic(cur);
    }
};
nextb.onRelease = function() {
    cur++;
    if (cur>pArray.length-1) {
        containerMC.loadPic(0);
        containerMC_2.loadPic(0);
    } else {
        containerMC.loadPic(cur);
        containerMC_2.loadPic(cur);
    }
};

I have posted the un-f’d code for clarity.

If someone can help me with the code that would be awesome.

Neil