Flash Tab 顺序更改

发布于 2024-07-22 14:10:55 字数 203 浏览 7 评论 0原文

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

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

长发绾君心 2024-07-29 14:10:55

您可以随时编辑元素 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

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

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

稚气少女 2024-07-29 14:10:55

我正在使用 Flash Player 11.4 进行编译,切换 TextField 的 tabEnabled 属性很好,但我发现它不适用于 SimpleButton(将 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;
}

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;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文