venerdì, settembre 05, 2008

AS3 - Detecting the Enter Key

A useful snippet courtesy of ActionScript.org.

stage.addEventListener(KeyboardEvent.KEY_DOWN, KeyDownFunc);

function KeyDownFunc(event){

if(event.keyCode == Keyboard.ENTER){

trace("enter");

}

}