Avg. Rating 3.0

Problem

After completing a project I noticed that when a user press the Tab key on the keyboard Flash shows the focus rectangle not a desired effect for a custom kiosk.

Solution

The first solution would be to set "tabChildren" to false per movie clip however this would have taken to much time. I decide to set "tabChildren" to false by checking when a user press the tab on the keyboard using the keypress then checking for the current target and setting the false value this would be the fast and set everything in one location.

Detailed explanation

//Add key down event listener
stage.addEventListener(KeyboardEvent.KEY_DOWN, myKeyDown);

/**
* Keyboard press function
* @param event
*
*/        
private function myKeyDown(event:KeyboardEvent):void
{
   if (event.keyCode == Keyboard.TAB)
   {
     trace("Key Down Tab");
     //Get current target and set tab children to false
     event.currentTarget.tabChildren = false;
   }
}

+
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

Report abuse

Related recipes