# Please help... next previous button question

**URL:** https://forum.kirupa.com/t/please-help-next-previous-button-question/299711
**Category:** Uncategorized
**Created:** [November 9, 2009, 10:43pm UTC](https://forum.kirupa.com/t/please-help-next-previous-button-question/299711 "2009-11-09T22:43:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![niyati73](https://avatars.discourse-cdn.com/v4/letter/n/51bf81/32.png) [@niyati73](https://forum.kirupa.com/u/niyati73)
#### Post date: [November 9, 2009, 10:43pm UTC](https://forum.kirupa.com/t/please-help-next-previous-button-question/299711/1 "2009-11-09T22:43:53Z")

</div>

Currently I have a single movie clip and next/ previous buttons attached to this movie clip. The image changes every 9 frames. Currently I have the code set to change at every frame. How do I get it so it changes at every 9 frames???

started flash just month ago… so please be gentle!

play();

previous\_btn.addEventListener(MouseEvent.CLICK, goBackward);  
next\_btn.addEventListener(MouseEvent.CLICK, goForward);

function goForward(e:MouseEvent){  
if(currentFrame == this.totalFrames){  
gotoAndPlay(1);  
}  
else{  
nextFrame();  
}

}

function goBackward(e:MouseEvent){  
if(this.totalFrames == currentFrame){  
gotoAndPlay(this.totalFrames == 1);  
}  
else{  
prevFrame();  
}  
}
