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!

  1. var konami:KonamiCode = new KonamiCode(this.stage);
  2. konami.addEventListener(KonamiCode.KONAMI,onKonami);
  3.  
  4. function onKonami(e:Event)
  5. {
  6.  trace('WOO, 30 LIVES!');
  7. }

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

Download it