3 Replies Latest reply on Apr 26, 2010 12:06 PM by Ned Murphy

    gotoAndStop error

    Lonnie Lomdeedoo

      I want to have buttons on frames 2 and 3 to allow the user to jump back and forth between the frames.  On frame 2 I have a button with instance name next_button.  On frame 3 I have a button with instance name back_button.  I have the following code in frame 2 which works fine:

       

      next_button.addEventListener(MouseEvent.CLICK,frame3);
      function frame3(e:MouseEvent):void
      {    gotoAndStop(3);
      }

       

      But when I add analogous code on frame 3, I get error messages.  After trying many things, I discovered that I get the same error messages even if the only action I have on frame 3 is a comment.  The error messages are 1023: Incompatible override and 1021: Duplicate function definition.

       

      How can I have a button on frame 2 to take me to frame 3, and a button on frame 3 to take me to frame 2?

        • 1. Re: gotoAndStop error
          Ned Murphy Adobe Community Professional & MVP

          If you are getting the 1021: Duplicate function definition error, it indicates that you have defined two or more functions in your file using the same function name... possibly a copy and paste oversight.  Make sure you don't have the function in frame3 named frame3 like you do in frame 2.  Also, place the two buttons on two different layers if they happen to be the same button symbol.  Flash has a way of making names of things the same when you place the same symbols in adjacent frames and don't name them the same.

          1 person found this helpful
          • 2. Re: gotoAndStop error
            Lonnie Lomdeedoo Level 1

            Ned, thank you for the suggestions!

             

            It looks like my function names were the problem.  When I changed the function named frame3 to goForward and the function named frame2 to goBack, it all works fine.

             

            Message was edited by: Lonnie Lomdeedoo

            • 3. Re: gotoAndStop error
              Ned Murphy Adobe Community Professional & MVP

              You're welcome