Need help with dynamic gallery scripts

alright. i’ve got a script that i’ve been fighting with for a while now. it’s a mish-mash of various scripts and some of my own stuff. this script is for the promo photos section of a gallery which features 3 sections [promo, live, flyers]. the user is sent to the frame containing these actions after clicking the promo button. added a couple comments here and there.

stop();
btnMain.onRelease = function() {
    gotoAndPlay("main");
    thumbnails._alpha = 0;
}

//load up xml data
myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {

//creates a row of thumbnails, lines them up as it goes.
    thumbnails._alpha = 100;
    numimages = this.firstChild.childNodes.length;
    spacing = 75;
    for (i=0; i<numimages; i++) {
        this.picHolder = this.firstChild.childNodes*;
        this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
        if (i<=1) {
            this.thumbHolder._y = i*spacing;
        } else if (i>1 && i<=3) {
            this.thumbHolder._x = 90;
            this.thumbHolder._y = (i*spacing)-150;
        } else if (i>3 && i<=5) {
            this.thumbHolder._x = 180;
            this.thumbHolder._y = (i*spacing)-300;
        } else if (i>5 && i<=7) {
            this.thumbHolder._x = 270;
            this.thumbHolder._y = (i*spacing)-450;
        }
        this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image", 0);
        this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
        this.thumbHolder.title = this.picHolder.attributes.title;
        this.thumbHolder.main = this.picHolder.attributes.main;
        this.thumbHolder.widthPop = this.picHolder.attributes.widthPop;
        this.thumbHolder.heightPop = this.picHolder.attributes.heightPop;

//set up the popup using xml data to fill in blanks
        this.thumbHolder.onRelease = function() {
            //customize the window that gets opened
            // 0 equals NO.
            // 1 equals YES.
            address = this.main;
            target_winName = "funk";
            width = this.widthPop;
            height = this.heightPop;
            toolbar = 0;
            location = 0;
            directories = 0;
            status = 0;
            menubar = 0;
            scrollbars = 0;
            resizable = 0;
            //sends data back to the function
            openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
        };
    }
};

myPhoto.load("photos_promo.xml");

//popup function
_root.openWinCentre = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
    getURL("javascript:var myWin; if(!myWin || myWin.closed){myWin = window.open('"+url+"','"+winName+"','"+"width="+w+",
height="+h+",toolbar="+toolbar+",location="+location+",
directories="+directories+",status="+status+",menubar="+menubar+",
scrollbars="+scrollbars+",resizable="+resizable+",
top='+((screen.height/2)-("+h/2+"))+',left='+((screen.width/2)-("+w/2+"))+'"+"')}else{myWin.focus();};void(0);");
};

what i really need to know is how i go about making the ‘next’ button function. so when a user clicks on the next button, the thumbnails reload the next set of thumbs [thumbs 1 - 8 load initially, next button appears. next is clicked, thumbs 9 - 17 load up, etc].

right click for fla: http://sour.org/senryu/x/site/photos.fla
the swf in action [click photos button, course]: http://sour.org/senryu/x/site/stage.htm

any clues? i’ve tried adding a next frame and reloaded the thumbs with a similiar script but not had much luck. i figure it’d be best to just refresh the thumbs using the next set of xml data… but haven’t figured that out quite yet.

i’m aiming to make it so that i just upload the new photos, thumbs and xml data and i’m done with it.

thanks for looking