I can't get the following keyboardevent to fire, unless you click into the textarea on the stage. Any ideas why that would be?
Note: I've tried adding the listener to: application, Application.application, the canvas on the stage, etc...

<?xml version="1.0" encoding="utf-8"?>
<mx:Application
    xmlns:mx="http://www.macromedia.com/2005/mxml"
    xmlns="*"
    layout="absolute"
     creationComplete="init()">
    <mx:Script>
        <![CDATA[
            import com.imagetrend.containers.debug.*;
            import mx.core.Application ;
            import flash.events.KeyboardEvent;
            import mx.controls.Alert;

            private function init() {
                this.addEventListener(KeyboardEvent.KEY_DOWN, trapKeys);               
            }
            private function trapKeys(e:KeyboardEvent) {
               textArea.text = String(e.charCode) + "/" + String(e.keyCode);
                Debugger.show();
                Alert.show("trapKeys()");
            }
        ]]>
    </mx:Script>   
    <mx:Canvas id="mainCanvas" width="100%" height="100%">
        <mx:TextArea id="textArea" width="236" height="196">
           
        </mx:TextArea>
    </mx:Canvas>   
               
</mx:Application>

--

: : ) Scott

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to