10 Replies Latest reply on Oct 8, 2007 12:23 PM by kglad

    How do you

    SuJun
      I "think" I am getting a handle on AS3, but I find the gotoFrame() command is associated with a movie clip not a button. In AS3 how do you tell a button go to a specific frame when clicked?

      "bButton" is the instance in this script:

      bButton.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);

      bButton.ButtonMode = true;

      function mouseDownHandler(evt:MouseEvent):void {

      }

      Thanks
        • 1. Re: How do you
          kglad Adobe Community Professional & MVP
          use the instance name of your movieclip in mouseDownHandler.
          • 2. Re: How do you
            SuJun Level 1
            Thank you, but I must not have stated things clearly. I am using a button symbol not a movie clip symbol. I'm trying to figure out how to tell a button symbol to go to a specific frame. It appears that "gotoFrame" is specifically for movie clips. Since buttons are interactive navigation symbols it seems illogical that there is not a way to tell them to go to a specific frame.
            • 3. Re: How do you
              kglad Adobe Community Professional & MVP
              that doesn't make sense because buttons don't have any frames.
              • 4. Re: How do you
                SuJun Level 1

                Buttons in Flash or other interactive media are often used to facilitate navigation. For example, clicking a button can send the user to a different frame on the timeline. I would like to know how to code a button to send the user to a specific frame on the timeline. I really hope I stated this clearly.

                Thank You
                • 5. Re: How do you
                  kglad Adobe Community Professional & MVP
                  if you want to direct a movieclip (say mc1) to a frame labeld "specialFrame", you can use:

                  • 6. Re: How do you
                    SuJun Level 1
                    Thank you! I'll give it a try.
                    • 7. Re: How do you
                      kglad Adobe Community Professional & MVP
                      you're welcome.
                      • 8. Re: How do you
                        SuJun Level 1
                        That did not work either. My current code is a follows:

                        bAbsorkas.addEventListener(MouseEvent.CLICK, mouseClickHandler);

                        bAbsorkas.ButtonMode = true; //<- this should be buttonMode

                        function mouseClickHandler(evt:MouseEvent):void {
                        this.gotoAndStop(3);
                        }

                        On line 4 I have tried mc(movie name), mc1, and this. I have also tried the 3 for a frme number in quotes. I have changed the mouse event to a click. Currently the click moves the timeline to frame three and does not stop.

                        The error code I am getting is:

                        Scene 1, Layer ‘actions’ Frame 2, Line 3 Description 1119: Access of possibly undefined property ButtonMode through a feference with static type flash.display:SimpleButton. Source, bAbsorkas.ButtonMode = ture;

                        For line three I have used bAbsorkas.ButtonMode = true and ButtonMode = true. Neither works.

                        While I would like to get this issue conquered, I may have to return to Actionscript 2.0. I see no other alternative.
                        • 9. Re: How do you
                          SuJun Level 1
                          Oh yeah! A frame label. Thanks!
                          • 10. Re: How do you
                            kglad Adobe Community Professional & MVP
                            as i mentioned above, ButtonMode should be butonMode.