<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" backgroundColor="#FFFFFF" applicationComplete="registerGlobalKeyHandler()"> <mx:Script> <![CDATA[ public function registerGlobalKeyHandler() :void { stage.addEventListener(KeyboardEvent.KEY_UP,handleKeyUP); } public function handleKeyUP(event:KeyboardEvent) :void { if(e.shiftKey&&(e.keyCode == 76 || e.keyCode == 108))
///在用户按下alt+L时执行相应代码
} ]]> </mx:Script> <mx:Label id="display" text="Click anywhere in the application and then press some keys." /> </mx:Application>