The following example from the help doesn't work. how do i make it 
work? thanks

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; 
initialize="initApp()">
    <mx:Script><![CDATA[
        private function initApp():void {
            application.addEventListener
(KeyboardEvent.KEY_UP,keyHandler);
        }

        //This function quits the application if the user presses 
CTRL+Q.
        private function keyHandler(event:KeyboardEvent):void {
            var bControlPressed:Boolean = event.shiftKey;
            if (bControlPressed) {
                var curKeyCode:int = event.keyCode;
                if (curKeyCode == 81) { // 81 is the keycode value 
for the Q key
                    // Quit the application by closing the browser 
using JavaScript.
                    var url:URLRequest = new
                        URLRequest("javascript:window.close()");
                    navigateToURL(url,"_self");                
                }
            }
        }
    ]]></mx:Script>
</mx:Application>

(btw one typo in the example...needed to remove the 'public' from 
the local variable)





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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to