6

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

4

2 回答 2

4

您可以随时设置编辑元素 tabIndex 值

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

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

以下对我有用

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);

您可以在此处下载示例 fla http://matrixoft.infunity.com/agents/calvin/flash/tab.rar

单击第三个按钮,它将更改标签顺序。当您 ctrl-enter 测试 fla 时,您可能需要“Control->Disable keyboard shortcuts”

于 2009-05-29T04:31:08.763 回答
2

我正在使用 Flash Player 11.4 进行编译 切换 TextField 的 tabEnabled 属性很好,但我发现它不适用于 SimpleButtons(将 tabEnabled 设置回 true 时它们不会再次启用)。为此,我正在使用这个:

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;
}
于 2013-12-11T06:28:42.390 回答