# Help with previous / next button as2

**URL:** https://forum.kirupa.com/t/help-with-previous-next-button-as2/295661
**Category:** Uncategorized
**Created:** [September 2, 2009, 5:44pm UTC](https://forum.kirupa.com/t/help-with-previous-next-button-as2/295661 "2009-09-02T17:44:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dodgedart](https://avatars.discourse-cdn.com/v4/letter/d/ea666f/32.png) [@dodgedart](https://forum.kirupa.com/u/dodgedart)
#### Post date: [September 2, 2009, 5:44pm UTC](https://forum.kirupa.com/t/help-with-previous-next-button-as2/295661/1 "2009-09-02T17:44:23Z")

</div>

Hi,

I posted this question a couple days ago and got no reply. I’m hoping someone can give a clue on how to set up this code. I’m sure its easy, but I’m just not that great with actionscript.

I have a website with a horizontal sliding gallery. There are buttons (numbers at the bottom) that when clicked slide a very long mc with thumbs on it to a specific xtarget position. That all works fine and dandy, but I want to get rid of the number buttons and put previous / next buttons instead. The thing that stumps me is this. Regular previous / next buttons would be coded to go to the next frame. I want to go to the next xtarget position instead. :joker: I’m using CS3 / AS2.

The link is: [http://www.brianlabriedesigns.com](http://www.brianlabriedesigns.com). Click the illustration button and you’ll see what I’m talking about. my button code is below.

Thank you very much for your help.

but1.onRollOver = function(){  
this.gotoAndPlay(“over”);  
}  
but1.onRollOut = function(){  
this.gotoAndPlay(“out”);  
}  
but1.onRelease=function(){  
xTargetMC = 1030;  
xTargetcontentMC = 970;  
}

but2.onRollOver = function(){  
this.gotoAndPlay(“over”);  
}  
but2.onRollOut = function(){  
this.gotoAndPlay(“out”);  
}  
but2.onRelease=function(){  
xTargetMC = 190;  
xTargetcontentMC = -290;  
}

but3.onRollOver = function(){  
this.gotoAndPlay(“over”);  
}  
but3.onRollOut = function(){  
this.gotoAndPlay(“out”);  
}  
but3.onRelease=function(){  
xTargetMC = -1430;  
xTargetcontentMC = -1565;  
}

but4.onRollOver = function(){  
this.gotoAndPlay(“over”);  
}  
but4.onRollOut = function(){  
this.gotoAndPlay(“out”);  
}  
but4.onRelease=function(){  
xTargetMC = -1430;  
xTargetcontentMC = -2905;  
}

but5.onRollOver = function(){  
this.gotoAndPlay(“over”);  
}  
but5.onRollOut = function(){  
this.gotoAndPlay(“out”);  
}  
but5.onRelease=function(){  
xTargetMC = -1430;  
xTargetcontentMC = -4220;  
}

but6.onRollOver = function(){  
this.gotoAndPlay(“over”);  
}  
but6.onRollOut = function(){  
this.gotoAndPlay(“out”);  
}  
but6.onRelease=function(){  
xTargetMC = -1430;  
xTargetcontentMC = -5590;  
}
