Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

phadam

macrumors regular
Original poster
Can someone tell me if my as3 is correct on this? Inside my page I have a previous and back button to take the user to images. 4 images total on my page.



nextBtn.addEventListener(MouseEvent.CLICK, nextSection);
prevBtn.addEventListener(MouseEvent.CLICK, prevSection);

function nextSection(event;MouseEvent):void{

var thisLabel:String = pages.currentLabel;
var thisLabelNum:String = thisLabel.replace("sct","");
var curNumber:Number = Number(thisLabelNum);
if (curNumber < 4{

var nextNum:Number = curNumber + 1;
pages.gotoAndStop("sct"+ nextNum):

}

}

function prevSection(event:MouseEvent):void{

var thisLabel:String = pages.currentLabel;
var thisLabelNum:String = thisLabel.replace("sct","");
var curNumber;Number(thisLabelNum);
 
Can't speak for all the code, but your if statement is missing a closing parenthesis.

Code:
if (curNumber < 4[COLOR="Red"])[/COLOR] {
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.