February 11th, 2009, by Bodie Leonard
How to use tabIndex and getting rid of the yellow box in AS 3.0
Enabling tabIndex
You can either code all your tabIndex’s or you can use the Accessibility panel to set the Tab Index which can be found in Windows > Other Panel > Accessibility or shortcut Shift F11.
elementName.tabIndex=1; // numbers from 1 – 65535
Enable any elements that are not to be used by tab shortcut key
elementName.focusRect = true;
Once the tab indexes order has been set and all the elements are enabled (or disabled if not in use) we can set the focus so users will know if they have tabbed to an element on the page.
elementName.addEventListener(FocusEvent.FOCUS_IN, changeHalo);
function changeHalo(e:FocusEvent):voidactionscrip 3
{
e.target.transform.colorTransform = 0xFFFFFF;
}
function changeHalo(e:FocusEvent):voidactionscrip 3
{
e.target.transform.colorTransform = 0xFFFFFF;
}
And now tabbing has been set for the form with no yellow boxes on focused elements.









When I try this I get this error:
TypeError: Error #1034: Type Coercion failed: cannot convert 16777215 to flash.geom.ColorTransform.
Any ideas?
@ James
what is the document type you are applying the color transform to? the element should be a movie clip, let me know if this helps.
@ James
what is the document type you are applying the color transform to? the element should be a movie clip, let me know if this helps.;. All the best!!