AS3 Konami Code Class
I wrote a simple Konami Code class for actionscript. Create an instance, pass the current stage, add an Event listener and do whatever you want!
-
var konami:KonamiCode = new KonamiCode(this.stage);
-
konami.addEventListener(KonamiCode.KONAMI,onKonami);
-
-
function onKonami(e:Event)
-
{
-
trace('WOO, 30 LIVES!');
-
}
the default sequence is up,up,down,down,left,right,left,right,b,a and it waits 1 second per keypress before the user has to do it again
