1 Reply Latest reply on Apr 25, 2009 9:21 AM by Ned Murphy

    How do you press a button object with ENTER key on the keyboard?

    FC1991

      Hello

      I have a button object, I want to be able to control with the ENTER/RETURN key on the keyboard

      so when ever I press the ENTER key, the button object goes into onPress stage.

       

      How can that be done?

       

      (thanks in advance)

        • 1. Re: How do you press a button object with ENTER key on the keyboard?
          Ned Murphy Adobe Community Professional & MVP

          I don't think you'll be able to control a Button symbol in the way you desire.  You probably need to create it as a MovieClip so that you can control what frame it is in.

           

          To utilize the ENTER key to take action, the following should work...

           

          var keyListener:Object = new Object();
          keyListener.onKeyDown = function() {
              if (Key.isDown(Key.ENTER)) {

                   // do your button_mc control here
              }
          };
          Key.addListener(keyListener);