Flash Tab顺序更改

Zoe*_*Zoe 6 flash actionscript-3 tab-ordering

我正在尝试将一些屏幕阅读器的可访问性添加到Flash应用程序中,并且正在遇到一个棘手的问题.Tabing through元素的顺序由这些元素的tabIndex属性设置.困难在于,从这些构造的选项卡列表似乎是永久性的,但应用程序的内容是动态的(从xml构建,包含弹出窗口和对话框).有没有办法刷新/重建选项卡列表?我愿意付出极大的努力,尝试一些疯狂的黑客来完成这项工作,所以任何建议都是好的.

Unr*_*ity 4

您可以随时编辑元素 tabIndex 值

就像将它们设置为与 childIndex 相同

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

以下对我有用

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);
Run Code Online (Sandbox Code Playgroud)

你可以在这里下载示例 fla http://matrixoft.infunity.com/agents/calvin/flash/tab.rar

单击第三个按钮,它将更改选项卡顺序。当您按 ctrl-enter 测试 fla 时,您可能需要“Control->禁用键盘快捷键”

  • 您的示例让我意识到我实际上并没有更改 TextArea tabIndex,而是更改了文本区域内的 TextField。我感觉自己很笨,不过你做得很好,谢谢^_^ (2认同)