7 Replies Latest reply on Apr 4, 2007 1:02 PM by kglad

    Code not accepting correct entry in input text field

    Denatram
      Can anyone tell me why this code does not proceed to "correct" when 133 is entered into the input text field titled "input_txt3"? I've used this code elsewhere with different text entry with success.

      keyListener = new Object();
      keyListener.onKeyUp = function() {
      if (input_txt3.text == "133" and Key.getCode() == 13) {
      //13 is key code for 'Enter'//
      gotoAndPlay("correct");
      _root.answer_txt = "Correct!";
      } else if (input_txt3.text != "133" and Key.getCode() == 13) {
      //13 is key code for 'Enter'//
      _root.answer_txt = "Incorrect.";
      gotoAndPlay("incorrect1");
      }
      };
      Key.addListener(keyListener);