Skip navigation
danlinenberg10
Currently Being Moderated

problem with Frame Label navigation

Jan 28, 2012 11:58 PM

Hello,

I'm pretty new to flash and i've been trying to make a presentation which is build out of several animations located on the main timeline.

I wanted to use frame labels to navigate back and forth in the timeline, so I created back/next buttons and used switch/case code on them based on the frame labels.

each animation has a label and a stop(); command at the end of it, right before the next animation.

the code for the next button looks like this:

 

next_btn.addEventListener(MouseEvent.CLICK, click_handler);

 

 

function click_handler(event_object:MouseEvent)

{

          switch (currentFrameLabel)

          {

                    case "frame1" :

                              gotoAndPlay("frame2");

                              break;

                    case "frame2" :

                              gotoAndPlay("frame2a");

                              break;

                    case "frame2a" :

                              gotoAndPlay("frame2b");

                              break;

                    case "frame2b" :

                              gotoAndPlay("frame3");

                              break;

                    case "frame3" :

                              gotoAndPlay("frame4");

                              break;

                    case "frame4" :

                              gotoAndPlay("frame5");

                              break;

                    case "frame5" :

                              gotoAndPlay("frame6");

                              break;

                    case "frame6" :

                              gotoAndPlay("frame7");

                              break;

                    case "frame7" :

                              gotoAndPlay("frame8");

                              break;

                    case "frame8" :

                              gotoAndPlay("frame9");

                              break;

                    case "frame9" :

                              gotoAndPlay("frame10");

                              break;

                    case "frame10" :

                              gotoAndPlay("frame11");

                              break;

                    case "frame11" :

                              gotoAndPlay("frame12");

                              break;

                    case "frame12" :

                              gotoAndPlay("frame13");

                              break;

                    case "frame13" :

                              gotoAndPlay("frame14");

                              break;

                    case "frame14" :

                              gotoAndPlay("frame15");

                              break;

                    case "frame15" :

                              gotoAndPlay("frame16");

                              break;

                    case "frame16" :

                              gotoAndPlay("frame17");

                              break;

                    case "frame17" :

                              gotoAndPlay("frame18");

                              break;

                    case "frame18" :

                              gotoAndPlay("frame19");

                              break;

                    case "frame23" :

                              gotoAndPlay("frame24");

                              break;

                    case "frame24" :

                              gotoAndPlay("frame25");

                              break;

                    case "frame25" :

                              gotoAndPlay("frame26");

                              break;

                    case "frame26" :

                              gotoAndPlay("frame27");

                              break;

                    default :

                              play();

          }

}

 

problem is at some point it stops working. i've added the "default: play();" code to try and fix it but it only goes so far.

 

is there any other way to do it?

 

 

thanks in advance.

 
Replies
  • Currently Being Moderated
    Jan 29, 2012 12:15 AM   in reply to danlinenberg10

    The condition you applied is wrong

     

    next_btn.addEventListener(MouseEvent.CLICK, click_handler);

    function click_handler(evt:MouseEvent)

    {

    gotoAndPlay(currentFrame - 1);

    }

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 29, 2012 4:23 AM   in reply to danlinenberg10

    For the next button you probabl;y only need to use the very last thing you show, the play() command.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points