Hi, I need help with a web site using flash, xml, and actionscript. What I'm trying to accomplish is to have my images loop at the click of a button. Currently the buttons continues to scroll the images leaving empty space after the last image. The function I'm using is onRollover but would rather use a different button function where the next set of images would display once the button is clicked not the continuous scrolling.

I have tried several tutorials and still can't seem to get it right. I am very new to flash and would greatly appreciate any help that you can give me.

These are the instances I'm using for AS2:
prtpanel = empty movie clip holder for thumbnails
left_btn = scroll thumbnails
right_btn = scroll thumbnails
xml file = print-portfolio.xml

The thumbnail panel (prtpanel) is set up to display only 4 images using a mask.

Finally here is the AS code:

stop();
//
var xml:XML = new XML();
xml.ignoreWhite = true;

//Load XML file
xml.load("print-portfolio.xml");

//
xml.onLoad = function(success) {
var numimages = xml.firstChild.childNodes.length;
spacing = 100;
for (i=0; i<numimages; i++) {
var picHolder = xml.firstChild.childNodes[i];
this.thumbHolder = prtpanel.createEmptyMovieClip("thumbnail"+i, i);
this.thumbHolder._x = i*spacing;
this.thumbHolder.title = this.picHolder.attributes.title;
this.thumbHolder.lrgimage = this.picHolder.attributes.lrgimage;

this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_i mage"+i, i);
this.thumbLoader.loadMovie(picHolder.attributes.th umb);

//Rollovers for thumbnails
this.thumbHolder.onRollOver = function() {
this._alpha = 50;
}
this.thumbHolder.onRollOut = function(){
this._alpha = 100;
}

//function for scroll buttons
right_btn.onRollOver = function() {
shouldScroll = false;
onEnterFrame = function () {
if (prtpanel._x >= -300) {
prtpanel._x -= 3;
prtpanel._x--;
} else {
delete (onEnterFrame);
}
};
};
right_btn.onRollOut = function() {
shouldScroll = true;
delete (onEnterFrame);
};

left_btn.onRollOver = function() {
shouldScroll = false;
onEnterFrame = function () {
if (prtpanel._x <= 40) {
prtpanel._x += 3;
prtpanel._x++;
} else {
delete (onEnterFrame);
}
};
};
left_btn.onRollOut = function() {
shouldScroll = true;
delete (onEnterFrame);
};

//create new movie and then load the thumbnails into it.
thumbHolder.onRelease = function() {
trace('images/');
};
}
};