How to Disable Tab Button Cheating using AS2
Have you ever made a game where you wanted to hide a button? Perhaps the button was used for a secret or unlockable in your game. Or maybe you have an escape the room game where you don’t want people cheating. Well, in this tutorial I’ll show you how to add some simple code to disable the use of those annoying yellow boxes that appear when a player presses the tab button in your game.
I’ve already mentioned how the tab button can be used to cheat in your game, but it also can distract from your gameplay. Suppose a player accidentally presses it, that ugly yellow box will appear around your game art or design. It just doesn’t look good. So how do you get rid of it?
Simple, just add this little piece of actionscript 2 to the frame:
button1.tabEnabled=false;//turn off the tab-ability of button1 button2.tabEnabled=false;//turn off the tab-ability of button2
You’ll need to be sure your buttons have an instance name, otherwise this won’t work, since the code relies on turning of the tab-ability of certain buttons.
That’s all. Now you know how to remove those annoying yellow boxes that appear around your button when tab is pressed.
Related posts:





August 20th, 2009 at 1:31 am
Very nice, great for escape the toom type games!
~Chaz
March 7th, 2010 at 7:38 am
This is very useful.
Do you know some code to disable it for the whole game, without having to apply this to each btn?