1 Reply Latest reply on Apr 12, 2008 9:55 PM by Amit_Kaushal

    Code I'm using for pressing 10

    Amit_Kaushal
      Hi all,

      keyListener = new Object();
      keyListener.onKeyUp = function() {
      trace(Key.getCode());
      var keyCode1 = Key.getCode();
      var keyCode2 = Key.getCode();
      if (keyCode1 == 97) {
      keyCode2 = Key.getCode();
      if (keyCode2 == 96) {
      gotoAndStop(10);
      } else {
      gotoAndStop(11);
      }
      } else {
      gotoAndStop(11);
      }
      };
      Key.addListener(keyListener);

      But its jumping to frame 11;
      I tried trace(key.getCode()), its also giving me 2 values 97 and 96 which are for 1 and 0 respectively. please help.
        • 1. Re: Code I'm using for pressing 10
          Amit_Kaushal Level 1
          found the solution!!!

          stop();
          keyListener = new Object();
          keyListener.onKeyUp = function() {
          var keyCode1 = Key.getCode();
          var keyCode2 = Key.getCode();
          if (keyCode1 == 97) {
          keyListener.onKeyUp = function() {
          keyCode2 = Key.getCode();
          if (keyCode2 == 96) {
          gotoAndStop(10);
          } else {
          gotoAndStop(11);
          }
          };
          } else {
          gotoAndStop(11);
          }
          };
          Key.addListener(keyListener);