3 Replies Latest reply on May 2, 2008 3:10 PM by kglad

    keyboard actions

    jc14
      I'm just trying to make a movie play / stop using keyboard option actions, i've assigned stop actions on key frames and on a seperate layer i've assigned:

      Key.ENTER;
      play();

      to a keyframe at the beginning of each scene.

      it works fine when I test the movie within flash, but when I export the movie to a swf the keyboard action doesn't work... i.e. it won't play when I press enter on the keyboard...

      please help..
        • 1. Re: keyboard actions
          kglad Adobe Community Professional & MVP
          that doesn't even work within flash. it just seems to work because the enter key is your default timeline play key.

          try:

          stop();
          this.onKeyDown=function(){
          if(Key.isDown(Key.ENTER)){
          this.play();
          }
          Key.addListener(this);
          • 2. Re: keyboard actions
            jc14 Level 1
            thanks very much for that.. for some reason it didn't work, not sure if it's because i've only got MX... but this did work:

            stop();

            keyWatch = new Object();
            Key.addListener(keyWatch);

            keyWatch.onKeyDown = function(){
            if(Key.getCode() == Key.ENTER){
            play();
            }
            };

            not really sure how or why but thank you anyway
            • 3. Re: keyboard actions
              kglad Adobe Community Professional & MVP
              i missed a right curly bracket: }

              and you're welcome.