# Help with next/previous code!

**URL:** <https://forum.kirupa.com/t/help-with-next-previous-code/307078>\
**Category:** Uncategorized\
**Created:** [March 27, 2010, 6:04pm UTC](https://forum.kirupa.com/t/help-with-next-previous-code/307078 "2010-03-27T18:04:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![suev3v](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@suev3v](https://forum.kirupa.com/u/suev3v)\
**Post date:** [March 27, 2010, 6:04pm UTC](https://forum.kirupa.com/t/help-with-next-previous-code/307078/1 "2010-03-27T18:04:01Z")

</div>

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

and how should i apply the code ?! maybe my method was wrong

Many thanks
