Adding next and previous buttons

Hi, i have created a flash photo gallery based on the Portfolio tutorial (http://www.kirupa.com/web/xml/examples/portfolio.htm), which i’ve adapted slightly to resize the image holder to fit each photo.

At present you just click on thumbnails of an image to load the enlarged version (like the tutorials), i was wondering if anyone out there knew how i’d go about adding next and previous buttons.

i tried afew things with absolutely no success so some suggestions would be awesome.

this is the code i have so far:

var thumb_spacing = 40;
spacing = 10;
var columns=2;
expander._width = 1;
expander._height = 1;

function GeneratePortfolio(portfolio_xml){
//creat image holder mc
nullmc.createEmptyMovieClip("image_mc", 0);
nullmc.image_mc._x = 240;
nullmc.image_mc._y = 55;
nullmc.image_mc._alpha =0;

		var portfolioPictures = portfolio_xml.firstChild.childNodes;
		for (var i = 0; i < portfolioPictures.length; i++){
		var currentPicture = portfolioPictures*;
		var currentThumb_mc = menu_mc.createEmptyMovieClip("thumbnail_mc"+i,i);
				
		currentThumb_mc._x = (i%columns)*thumb_spacing;
		currentThumb_mc._y = Math.floor(i/columns)*thumb_spacing;
		currentThumb_mc._alpha = 0;
		currentThumb_mc.createEmptyMovieClip("thumb_container",0);
		currentThumb_mc.thumb_container.loadMovie(currentPicture.attributes.thumb);
		currentThumb_mc.onEnterFrame = fadeinb;
		
		currentThumb_mc.title = currentPicture.attributes.title;
		currentThumb_mc.image = currentPicture.attributes.image;
		currentThumb_mc.width = currentPicture.attributes.width;
		currentThumb_mc.height = currentPicture.attributes.height;
		currentThumb_mc.description = currentPicture.attributes.description;

			
		
		currentThumb_mc.onRollOver = currentThumb_mc.onDragOver = function(){
			info_txt.text = this.title;	
			//this.onEnterFrame = fadein;
		}
		currentThumb_mc.onRollOut = currentThumb_mc.onDragOut = function(){
			info_txt.text = "";
			//this.onEnterFrame = fadeout;
		}
		currentThumb_mc.onPress = function(){
			this._alpha += 101;
			main_title.text = "Current Photo - " + this.title;
			description_txt.text = this.description;
    	    nullmc.image_mc.loadPic(this.image, this.width, this.height);			
		}	
	}		
	}
			

MovieClip.prototype.loadPic = function(pic, w, h){
	nullmc.image_mc._alpha = 0;
	this.loadMovie(pic);
	_root.onEnterFrame = function(){
		var t = nullmc.image_mc.getBytesTotal(), l = nullmc.image_mc.getBytesLoaded();
		if (t != 0 && Math.round(l/t) == 1){
    		//var w = nullmc.image_mc._width + spacing, h = nullmc.image_mc._height + spacing;
			expander.resizeMe(w, h);
			delete _root.onEnterFrame;
		}
	}
};
MovieClip.prototype.resizeMe = function(w, h){
var speed = 4;
	this.onEnterFrame = function(){
		//menu_mc._x = this._x - this._width/2 - menu_mc._width- spacing;
		main_title._x = this._x - this._width/2;
		main_title._y = this._y + this._height/2 + spacing/2 - 5; //+ (this._height - 5);
		this._width += (w - this._width)/speed;
		this._height += (h - this._height)/speed;
		if( Math.abs(this._width-w)<1){
			this._width = w;
			this._height = h;
			//nullmc.image_mc._x = this._x - this._width/2 + 30;
			//nullmc.image_mc._y = expander._y - this._height/2+ 30;
			nullmc.image_mc._x = this._x - this._width/2 + spacing/2 -0.5;
			nullmc.image_mc._y = expander._y - this._height/2+ spacing/2;
			nullmc.image_mc.onEnterFrame = function() {
			foo = 0;
			while(foo < 5) {
			this._alpha = this._alpha + 1;
			foo++; 
			}
			}
			delete this.onEnterFrame;
		}
	}
};

//fade in and out functions
fadein = function()
{
	this._alpha+=2;
	if (this._alpha >=100)
	{
		delete this.onEnterFrame;
	}}
fadeinb = function()
{
	this._alpha+=1;
	if (this._alpha >=60)
	{
		delete this.onEnterFrame;
	}}
fadeout = function()
{
	this._alpha-=2;
	if (this._alpha <=50)
	{
		delete this.onEnterFrame;
	}}

// xml object for xml content (defines sources for selections)
var portfolio_xml = new XML();
portfolio_xml.ignoreWhite = true;
portfolio_xml.onLoad = function(success){
	if (success) GeneratePortfolio(this);
	else main_title.text ="Error loading XML file"; // no success?  trace error (wont be seen on web)
}
// load XML file
portfolio_xml.load("photos.xml");

// next / previous functions
listen = new Object();
listen.onKeyDown = function() {
	if (Key.getCode() == Key.LEFT) {
		prevImage();
			} else if (Key.getCode() == Key.RIGHT) {
		nextImage();
			}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
	prevImage();
	};
next_btn.onRelease = function() {
	nextImage();	
};

function nextImage() {
trace("next");
	
}

function prevImage() {
trace("previous");
}
stop();
	

Thanks