8/9/2010 3:40:29 AM
Title:
keyEquivalent
can anyone provide me an example to invoke a function on a key stroke using keyEquivalent ?
8/9/2010 8:51:28 AM
you can add keylistener which is invoked when key is pressed
//call this function to add keylistener
public function addKeyListener():void{
// add listener to stage to capture key down
stage.addEventListener(KeyboardEvent.KEY_DOWN,KeyDownOccured);
}
// listener function
private function KeyDownOccured(evt:KeyboardEvent):void{
trace("Key pressed is: "+evt.keyCode);
}