Slide menu navigation

Hello.

I’m trying to put together a sideshow using a modification of load_images.fla (a sample file supplied with Flash) combined the the ‘Kirupa Menu with Slider’ tutorial (http://www.kirupa.com/developer/mx2004/menu_with_slider.htm)

The slideshow uses a ‘next’ & ‘previous’ button to click thought the images. In addition to this I have a separate slide menu navigation (currently just numbers 1-7), with a rectangle highlighting the number of the image being viewed.

I would like to move the rectangle to show which image is being viewed, when the ‘next’ or ‘previous’ button is pressed.

The follow code shows the actionscript for the ‘next’ & ‘previous’ buttons…

next_btn.onPress = function() {
	if (whichPic<7 && !fadeIn && !fadeOut) {
		fadeOut = true;
		whichpic++;
		input = whichPic;
		//slider.xMove = button_7._x;
	}
};
back_btn.onPress = function() {
	if (whichPic>1 && !fadeIn && !fadeOut) {
		fadeOut = true;
		whichpic--;
		input = whichPic;
	}
};

…as a test the commented code ‘slider.xMove = button_7._x;’ will advance the rectangle to 7 but I would like it to just advance either way when the button is clicked.

I guess what it needs is something like…

slider.xMove = "button_"+whichPic+"._x";

…but that doesn’t work.

Any help would be appreciated.