Flex Accessibility - Cannot set screen reader order
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 usi开发者_开发技巧ng 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?
You'll want to use Text instead of Label. Documentation:
A Label control is read by a screen reader when it is associated with other controls, or when the Forms mode is inactive. The Label control is not focusable in Forms mode, or by the keyboard.
...
A Text control is not focusable and is read by screen readers only when Forms mode is inactive.
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.
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
精彩评论