What would be the best way to implement the konami code into a flex application?
I want to create a component to add it on all my proyects, just for fun.
thanks<
var unlockCode:Array = new Array(38,38,40,40,37,39,37,39,66,65,13);
var keyPressArray:Array = new Array();
stage.addEventListener(KeyboardEvent.KEY_DOWN, checkUnlockCode);
function checkUnlockCode(e:KeyboardEvent):void {
if (keyPressArray.length >= unlockCode.length) {
keyPressArray.splice(0,1);
keyPressArray.push(e.keyCode.toString());
} else {
keyPressArray.push(e.keyCode.toString());
}
trace(keyPressArray);
if (keyPressArray.toString() == unlockCode.toString()) {
trace(unlockCode);
}
}