3 Replies Latest reply on Nov 2, 2011 10:41 AM by Ned Murphy

    Go to previous keyframe

    Iulian25 Level 1

      Hey! I am a rookie to Flash.I am making a simple project ,a so called "quizz" .SO as every questions has wrong and true answers buttons I am wondering how do I go to the previous keyframe.Let me be more clear. I have this "screen" with a button that appears only when you click the "wrong answer" on a question,the screen has a button that will lead you to the menu to start a new game,but I realized that would be very ANNOYING ,because if we are at question 30 [we pretend] it would be very frustrating to start all over again.So I am wondering what code do I need to write to the Screen with the "start over" button that leads to menu to make it lead me to the question I  Answered wrong. I want to say that I tried something like "on (release) { gotoAndPlay ("previous") ;} but didn`t work To be even more clear I will show you on this picture.The start over button will get me at the menu,I want it to get me at the question I answered wrong!.

       

      Sincerely ,Thank you, Flash rookie Untitled.jpg

        • 1. Re: Go to previous keyframe
          Ned Murphy Adobe Community Professional & MVP

          Try using prevFrame();  it's purpose in life is to bring you to the previous frame and stop.

          • 2. Re: Go to previous keyframe
            Iulian25 Level 1

            Thank you for answering but it doesnt work,the code you showed me leads me to the prevoius frame of the button`s frame,I want a code [if there is one] that will lead me from the "start over button" in the pic. to the question I answered wrong

            • 3. Re: Go to previous keyframe
              Ned Murphy Adobe Community Professional & MVP

              First, you should not be placing code "on" objects as it is not a good practice, but to get you over that hump you can probably just use: _root.prevFrame(); where you put prevFrame(); 

               

              The proper way to code is to assign instance names to the objects and place the code in the timeline.  So if you give your button an instance name of "startOver", the timeline version of the code would be...

               

              startOver.onRelease = function(){

                   prevFrame();

              }

              1 person found this helpful