Previous and Next Frame Labels

Discussion in 'Web Design and Development' started by phadam, Aug 24, 2009.

  1. phadam macrumors regular

    Joined:
    Jan 21, 2009
    #1
    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);
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    Can't speak for all the code, but your if statement is missing a closing parenthesis.

    Code:
    if (curNumber < 4[COLOR="Red"])[/COLOR] {
     
  3. phadam thread starter macrumors regular

    Joined:
    Jan 21, 2009

Share This Page