5 Replies Latest reply on Mar 23, 2011 2:45 AM by MauriceMul

    Spark TextArea keyDown

    Zolotoj Level 3

      I am trying to prevert from going to the next line while pressing Enter key. For that I am adding the following listener:

       

      public function gridTextItemEditor()
              {
                  super();
                  addEventListener("keyDown", onEnter);
              }

       

      private function onEnter(event:KeyboardEvent):void
              {
                  trace(event.keyCode);
                  if (event.charCode == 13)
                  {   
                      event.preventDefault();
                  }   
              }  

       

      dont see trace when I press Enter. What's wrong with my code?

       

      Thanks