Capture key sequences in ActionScript 3. AKA The Konami Comeback.

6/06/2009

Contra Konami
Lately the internet has had a wave of sites using the cherished Konami Cheatcode to reveal easter eggs or similar functionality in the site or app.

I wrote a (crappy but working) class to implement such functionality in ActionScript about a year ago here.

I decided to polish it up a bit for the benefit of myself and anyone else and in the process ended up creating a small utility class to work with keystrokes in the process.

You can download the (fairly self-expaining) classes and a sample project right here, or read on for a bit of explanations.

(Text) Keys.as.
(Text) Konami.as.
(Archive) Neatly zipped + example.

Read the rest of this article »

3 Comments

Up Up Down Down Left Right Left Right B A

29/03/2008

While showering last night (this is usually when ideas and / or solutions present themselves) I came up with this idea.

Basically it’s a simple class that allows you to listen for specific sequences of keystrokes. So if the user was to press the sequence in the title, in the correct order naturally, you might react to it in any way you might deem funny. Code beneath the cut.

(BTW: I’m not all that familiar with the Text package in AS3 yet, so if there is some kind of method that does this for you please let me know.)

Read the rest of this article »

1 Comment