The following example shows how you can close a pop up window when a user presses the Escape key in Flex. Full code after the jump. View MXML <?xml version="1.0" encoding="utf-8"?> <!-- http://blog.flexexamples.com/2008/08/04/closing-a-pop-up-window-using-the-keyboard-in-flex/ --> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top" backgroundColor="white