9 Replies Latest reply on Sep 20, 2006 7:06 AM by kglad

    Key Code Dynamic text box

    Zealouse Level 1
      For the life of me I can't fiqure out why this code is not working!!!
      I can not get a ASCII value from a key strock to diplay in a text box. Any idea's?

      Here is the Code:

      var sentence:String = new String();
      var keyListener:Object = new Object();
      keyListener.onKeyDown = function() {
      myText.text += String.fromCharCode(Key.getAscii());
      trace("\tThe Key code is: "+Key.getCode());
      trace("\tThe ASCII value is: "+Key.getAscii());

      if ((Key.getCode()) == (13)) {
      myPlay.play();
      }
      };
      Key.addListener(keyListener);