How do i stop my slider sliding?

hi there, just joined & am a complete flash novice so please feel free to laugh at my bastardised script :slight_smile:

i’m trying to make a dynamic slideshow taking in pics from xml. so far so good… (thanks to other peoples hard work!)
i’d like my thumbnails to scroll left & right (just using next & prev buttons). all’s grand, they scroll… but my problem is i don’t know how to STOP them scrolling when i run out of thumbnails. i’m left with a gaping white space:)

i don’t suppose there’s an simple bit of code that says something like:

if (you run out of thumbnails) {
stop(this.scrolling!!);
} else {
keep.scrolling(“your doing a great job”);
}
?

my scrolling code so far is:

function SlideMenu() {
this._x += (newX-this._x)/10;
this._y += (newY-this._y)/10;
}

// This next line calls the funtion named SlideMenu
menu_mc.onEnterFrame = SlideMenu;

//The next line is where you indicate the total number of display area(s)
PageTotal = i++;

//The following function is assigned to the Forward button
next_mc.onPress = function() {
XNumber–;
newX = -XNumber*-50;
newY = -YNumber*0;
}

//This is a similar function for the Back button except in reverse

previous_mc.onPress = function() {
XNumber++;
newX = -XNumber*-50;
newY = -YNumber*0;
};

would really appreciate some help… i haven’t a clue what i’m doing :wink:
cheers
naoimh