How do i make something happen when i press a key?

3 posts

Flag Post

I’m working on my flash game for Kongregate, but for some odd reason i forgot how you make something happen when a key is pressed. In this case, i want the game to go to frame 821, the “CHEATER” frame, when i press TAB (makes you find buttons easier). Just asking if anyone knows the code for this? I knew it before, i don’t know why i don’t remember. XD

Flag Post

In your enterFrame stuff:

if (Key.isDown(Key.TAB)) {

But if you don’t want the tab boxes to come up, you can just put

tabChildren = false;

on frame 1 of your movie and it will disable tabbing through buttons.

Flag Post

ah thanks alot mate, helps alot! i didn’t know that!