0

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?

blahdiblah
  • 33,069
  • 21
  • 98
  • 152
Wesley Petrowski
  • 1,131
  • 7
  • 11

2 Answers2

0

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.

Community
  • 1
  • 1
J_A_X
  • 12,857
  • 1
  • 25
  • 31
  • Thanks for the response. I am still unable to change the reading order when using a Text control, though. – Wesley Petrowski Apr 13 '11 at 22:13
  • My problem is not in getting the text to be read in the first place - that works fine. The issue is controlling the reading order. In the actual application I am dealing with, the page layout is somewhat complex and I need to be able to specify the order in which text on the page is read, because the default ordering based on position doesn't get it right. – Wesley Petrowski Apr 13 '11 at 22:17
  • Ah gotcha. Well, tab index only works for components within the same container. So if your text isn't within the same container, you're going to have some trouble unless you hack something together. Now that I think of it, I'm surprised nobody's ever done a library to make this easier to deal with... – J_A_X Apr 14 '11 at 12:16
0

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

Drenai
  • 11,315
  • 9
  • 48
  • 82
  • Thanks for the response. I remember reading about putting a copy of the content offstage at some point, now that you mention it again. Although, I suspect it would probably be just as much work as switching to Spark components, so I might just end up doing that if it comes down to it. Thanks for the tip on spacing out the tabIndex values - I'll keep that in mind! – Wesley Petrowski Apr 14 '11 at 16:32