Event Flex




    
        
            import flash.events.KeyboardEvent;
            private function keyHandler(event:KeyboardEvent):void
            {
                switch(event.keyCode)
                {
                    case 13:
                        trace(" Enter pressed ");
                    break;
                    case 32:
                        trace(" Space Bar pressed ");
                    break;
                    case 16:
                        trace(" Shift Key pressed ");
                    break;
                    case 112:
                        trace(" F1 pressed ");
                    break;
                    case 8:
                        trace(" Delete pressed ");
                    break;
                }
            }