2 Replies Latest reply on Jul 31, 2010 9:23 AM by thebuntha

    Problem regarding KeyBoardEvent

    thebuntha Level 1

      I was trying a keyboard event example and could not understand a logic . The code was -



      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
          minWidth="955" minHeight="600"
       <!-- Place non-visual elements (e.g., services, value objects) here -->
       import mx.core.FlexGlobals;
       internal function initApp():void{
       internal function keyUp(event:KeyboardEvent):void{
       label.text = event.keyCode+"/"+event.charCode;
       <s:TextInput id="input" focusEnabled="true"/>
       <s:Label id="label"/>



      In the above example , in the listener we are appending KEY_UP but in the keyboard if we try any key like any character key , it sets the value of label.

      So how does it happening. If the listener is being set for only Key_UP stroke , why the label is changing for clicking any key on the keyboard.