SAludos!!!!
// Button Listeners
nextBtn.addEventListener(MouseEvent.CLICK, nextSection);
prevBtn.addEventListener(MouseEvent.CLICK, prevSection);
///////////////////////////////////////////////////////////////////////////
function nextSection(event:MouseEvent):void {
var thisLabel:String = pages.currentLabel; // gets current frame label as string
var thisLabelNum:String = thisLabel.replace("sct", ""); // cuts the leading letters off of the number
var curNumber:Number = Number(thisLabelNum); // converts that string number to a real number
if (curNumber < 5) {
var nextNum:Number = curNumber + 1; // adds 1 to the number so we can go to next frame label
pages.gotoAndStop("sct" + nextNum); // This allows us to go to the next frame label
}
}
///////////////////////////////////////////////////////////////////////////
function prevSection(event:MouseEvent):void {
var thisLabel:String = pages.currentLabel; // gets current frame label as string
var thisLabelNum:String = thisLabel.replace("sct", ""); // cuts the leading letters off of the number
var curNumber:Number = Number(thisLabelNum); // converts that string number to a real number
var prevNum:Number = curNumber - 1; // subtracts 1 from the number so we can go to next frame label
pages.gotoAndStop("sct" + prevNum); // This allows us to go to the previous frame label
}