1 Reply Latest reply on Jul 3, 2011 11:34 AM by RobotMonkey

    Spark textArea charCodes repeat in a loop

    RobotMonkey Level 1

      I am having a weird problem since the latest flex/air release (2.7). Most of the keys on the keyboard only give the correct charCode on first press, then they do a loop from charCode 48 to 57. Some keys are immune, like the tilde which always returns 96.

       

      Example:


      This code pushes the charCode number into the textarea so it can be examined so you can try this yourself:

       

      protected function onKeyDown(event:KeyboardEvent):void{
                      Editor.insertText(" " + event.charCode.toString() + "=");
                  }

       

      <s:TextArea id="Editor" width="100%" height="100%"
                       keyDown="onKeyDown(event)"  />

       

       

      The result for the letter 'a' looks like this:

      97=a 50=a 51=a 52=a 53=a 54=a 55=a 56=a 57=a 48=a 49=a ... looping forever at this point but never showing 97 (the correct one) again.

       

       

      Anyone have a guess as to what's going on? This had been working fine for me until one of the last builds of the SDK.

       

      Thanks in advance!