Help with next/previous buttons code!

**[SIZE=2]Im trying to make a slide show with a next and previous button. I have name these two buttons next_button and previous_button

I 've tried the code ;

next_button.onRelease = goNext;
previous_button.onRelease = goPrev;

function goNext():Void{
gotoAndPlay(_currentframe+1);
}
function goPrev():Void{
gotoAndPlay(_currentframe-1);
}

however , it isn’t working , can anyone help?! plzzzzzzzzzzzzz
btw, i m using Adobe Flash CS3, action script 2
and how should i apply the code ?! maybe my method was wrong

Many thanks[/SIZE]**