Flex 辅助功能 - 无法设置屏幕阅读器顺序
我遇到一个问题,无法在 Flex 应用程序中为文本设置自定义阅读顺序。我在每个文本元素上设置 tabIndex
属性,据我所知,这是设置屏幕阅读器阅读顺序的正确方法。
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute">
<mx:Label x="10" y="10" text="1" tabIndex="2" />
<mx:Label x="10" y="36" text="2" tabIndex="1" />
<mx:Label x="10" y="62" text="3" tabIndex="3" />
</mx:Application>
对于这个小型测试应用程序,屏幕阅读器 (JAWS 12) 读取“1 2 3”而不是“2 1 3”。
一些测试似乎表明这只是我的特定配置的问题。我正在使用 Flex SDK 4.1 编译应用程序,但仅使用 MX 组件集和 Halo 主题。我们有一个相当复杂的应用程序,它是在 Flex 4 出现之前就开始的,因此虽然我们已经使用最新的 SDK 进行了编译,但我们还没有升级任何东西来使用 Spark 组件集。
当我使用 4.1 SDK 和 Spark 组件+主题制作类似的测试应用程序时,读取顺序设置正确。如果我制作一个测试应用程序并使用 3.5 SDK 进行编译,结果相同 - 一切正常。
我知道我可以改用 Spark 组件,但如果可以的话我会尽量避免这种情况,因为这意味着我正在处理的当前项目的时间表必须改变。
有没有人遇到任何类似的问题,或者有任何可能让它发挥作用的建议?
I'm having a problem where I'm not able to set up a custom reading order for text in my Flex application. I'm setting the tabIndex
property on each text element, which I understand is the proper way to set the reading order for a screen reader.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute">
<mx:Label x="10" y="10" text="1" tabIndex="2" />
<mx:Label x="10" y="36" text="2" tabIndex="1" />
<mx:Label x="10" y="62" text="3" tabIndex="3" />
</mx:Application>
For this small test application, the screen reader (JAWS 12) reads "1 2 3" instead of "2 1 3".
Some testing seems to indicate that this is only a problem for my particular configuration. I am compiling the application with Flex SDK 4.1, but using the MX component set only, and the Halo theme. We've got a fairly complex app which started out before Flex 4 was around, so while we have made the jump to compile with the latest SDK, we have not yet upgraded anything to use the Spark component set.
When I make a similar test app using the 4.1 SDK and the Spark components+theme, the reading order is set correctly. Same result if I make a test app and compile using the 3.5 SDK - everything works.
I know I could switch to using Spark components, but I'm trying to avoid that if I can as it would mean timelines would have to change on the current project I'm working on.
Has anyone run into any similar issues, or have any suggestions that might get this to work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要使用文本而不是标签。文档:
...
我还发现了这个,这可能是一个更好的解决方案。示例是在 Flex 4 中,但是您可以对 Flex 3 中的 Label 执行相同的操作,只需实现 IFocusManagerComponent 接口即可。
You'll want to use Text instead of Label. Documentation:
...
I also found this which might be a better solution. The example is in Flex 4, but you can do the same with Label in Flex 3, just need to implement the IFocusManagerComponent interface.
我目前在 Flex 3 中使用 JAWS 11,所以还没有遇到这个问题。但是,我读过一种将组件副本放在后台的选项,这对于我们的需求来说太复杂了,并且让屏幕阅读器按顺序读取这些组件:
http://www.adobe.com/accessibility/products/flash/reading.html#off_stage
另外,我看到了一个技巧是以 10 为增量设置 TabIndex。JAW 只关心它们的顺序,如果您需要添加额外的组件,则无需对所有内容重新编号。即 10、20、30,然后如果需要,可以添加 11,而不是重新编号所有内容。
布莱恩
Im working with JAWS 11 in Flex 3 at the moment, so havnt had that problem yet. But, i've read about one option of putting copies of the components offstage, its too complicated for our needs, and letting the screen reader just read these components in order:
http://www.adobe.com/accessibility/products/flash/reading.html#off_stage
Also, a trick I saw was to set the TabIndex in increments of 10. JAWs only cares about their order, and if you need to add extra components, you wont need to renumber everything. i.e. 10, 20, 30 then if you need you can add 11, rather than renumbering everything.
Brian