Friday, December 19, 2008

AS3 Disable Yellow Tab Rectangles

Are you wondering why when you hit tab in your Flash site you get those nasty yellow rectangles around your links? Here's how to disable them:

If you have a movieclip with a bunch of buttons inside it and you want to disable all of them with one line of code use this:
MC_Container_Name.tabChildren = false;


Or to just disable the yellow box on a single movieclip use this:
MC_Name.tabEnabled = false;

5 comments:

Homem RobĂ´ said...

I love your website.. I have one for you, my favorite removeChild code:

if(MC) if(MC.parent ) MC.parent.removeChild(MC);

Mattias said...

if you set tabEnabled to false you will simply remove the items from the tabList (so you won't be able to tab to them anymore).
If you just want to remove the yellow box (but still leave the item enabled for tabbing), use the focusRect property.

Anonymous said...

solution is this.stage.stageFocusRect = false;

Omar said...

Thanks!

Anonymous said...

Hi,
I've run into this strange thing with tabbing.
I have a few input text field, with NO actionscript.
When you try to tab, it gives this error message:

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.

using tabEnabled = false, doesn't help.

Does anyone have any ideas what could cause this??

thanks