3 Replies Latest reply on Mar 19, 2007 7:26 AM by kglad

    Capture the delete Key

    TheScarecrow Level 1
      I want to trigger something when the backspace key is entered but the code i have nothing happens when I push it. Is the code wrong? I dont get the trace when I push it but if I push other keys I get the second part of the trace.
      var keyListener:Object = new Object();
      keyListener.onKeyDown = function() {
      if (Key.isDown(Key.BACKSPACE)) {
      trace("you pressed the Backspace key.");
      } else {
      trace("you DIDN'T press the Backspace key.");
      }
      };
      Key.addListener(keyListener);