Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flash Tab Order changes

I'm trying to add some accessibility for screen readers into a Flash application, and am running up against a sticky point. The order for tabbing through elements is set by those elements' tabIndex property. The difficulty is, the tab list constructed from these seems to be permanent, but the content of the application is dynamic (built from xml, contains pop ups and dialog boxes). Is there a way to refresh/rebuild the tab list? I am willing to go to extreme lengths, and try some crazy hacks to make this work, so any suggestions are good.

like image 254
Zoe Avatar asked May 29 '09 04:05

Zoe


2 Answers

you set edit the elements tabIndex values at any time you want

like setting them to be the same to childIndex

for (var i:int=0;i<container.numChildren;++i) {
    container.getChildAt(i).tabIndex = i; //=i or anything you want
}

The following works for me

iButton1.tabIndex = 1;
iButton2.tabIndex = 2;
iButton3.tabIndex = 3;

iButton1.tabEnabled = true;
iButton2.tabEnabled = true;
iButton3.tabEnabled = true;

function fnClick (pME:MouseEvent):void {
    iButton1.tabIndex = 3;
    iButton2.tabIndex = 2;
    iButton3.tabIndex = 1;
}

iButton3.addEventListener(MouseEvent.CLICK, fnClick);

you can download a sample fla here http://matrixoft.infunity.com/agents/calvin/flash/tab.rar

click the third button and it will change the tab order. You may need to "Control->Disable keyboard shortcuts" when you ctrl-enter to test the fla

like image 170
Unreality Avatar answered Sep 28 '22 08:09

Unreality


I am compiling with Flash Player 11.4 Toggling the TextField's tabEnabled property is fine, but I am finding that it does not work for SimpleButtons (they don't become enabled again when setting tabEnabled back to true). For that I am using this:

private function setPanelOneTabIndices()
{
    aButton1.tabIndex = 1;
    aButton2.tabIndex = 2;
    aButton3.tabIndex = 3;

    bButton1.tabIndex = 0;
    bButton2.tabIndex = 0;
    bButton3.tabIndex = 0;
}

private function setPanelTwoTabIndices()
{
    aButton1.tabIndex = 0;
    aButton2.tabIndex = 0;
    aButton3.tabIndex = 0;

    bButton1.tabIndex = 1;
    bButton2.tabIndex = 2;
    bButton3.tabIndex = 3;
}
like image 37
Fans Avatar answered Sep 28 '22 07:09

Fans