In a frame actionscript space:
-------------
// create a variable to hold the current button...
var currentButton:String;
// create the array and populate it with the instance names of the
buttons...
var buttonArray:Array = new Array(button1,button2,button3,button4);
var buttonArrayCount:Number = buttonArray.length - 1;
// assign a function for the mouse up event to each button:
for (i in buttonArray) {
buttonArray[i].onRelease = buttonMoveFunction;
}
// when the user selects one of the date buttons...
function buttonMoveFunction() {
currentButton = this;
gotoAndStop(X);
// X is the frame number or label that you want to move to
// I would use frame labels and make a corresponding array to the
label names
}
// the next button, for this example I'm expecting the next button,
instance name to be "nextButton"
nextButton.onRelease = function() {
for (i in buttonArray) {
if((buttonArray[i] == currentButton) && (currentButton !=
buttonArray[buttonArrayCount])) {
currentButton = buttonArray[i + 1];
gotoAndStop(X);
} else if (currentButton == buttonArray[buttonArrayCount]) {
// you're at the end, you could loop back to the beginning if
that's appropriate, if not, just leave out the else if part.
}
}
}
previousButton.onRelease = function() {
for (i in buttonArray) {
if((buttonArray[i] == currentButton) && (currentButton !=
buttonArray[0])) {
currentButton = buttonArray[i - 1];
gotoAndStop(X);
} else if (currentButton == buttonArray[0]) {
// you're at the beginning, you could loop to the end if that's
appropriate, if not, just leave out the else if part.
}
}
}
-----------------
That's all off the top of my head, I haven't tested it, but it should
get you started.
--
Rob
_______
Rob Dillon
Adobe Community Expert
http://www.ddg-designs.com 412-243-9119