0 Replies Latest reply on Apr 12, 2008 6:19 AM by Amit_Kaushal

    Working with Enter Key - Reply ASAP pls

    Amit_Kaushal
      Hi all,

      I'm working with Actionscript 2.0. I am applying the following code

      keyListener = new Object();
      keyListener.onKeyUp = function() {
      var keyCode = Key.getCode();
      if (keyCode == 13) {
      gotoAndPlay(1318);
      }else {
      gotoAndStop(1314);
      }
      };
      Key.addListener(keyListener);

      Problem I'm facing is that its not working with the enter key , however if i'm giving any other key code then its working. Infact if i'm giving the following code

      keyListener = new Object();
      keyListener.onKeyUp = function() {
      var keyCode = Key.getCode();
      if (keyCode == 13) {
      gotoAndPlay(1318);
      }else if (keyCode == 32) {
      gotoAndPlay(1318);
      }else{
      gotoAndStop(1314);
      }
      };
      Key.addListener(keyListener);

      Then its working fine but only in the case of else if part ( key Code==32, space bar ), but not with the enter key.
      Please help.