After adding accessibility support to some Flash components I’ve been developing recently, I wanted to give them a test drive. To my surprise, I discovered that Flex and Flash components that Adobe claims are accessible aren’t very usable in a screen reader environment. I have always pointed out to people who claim that Flash isn’t accessible that Flash Player supports screen readers, but it must be specifically enabled by the developer. Until I see better results (even from the official Flex components!), I will no longer make that argument.
I started my adventure by installing a trial of JAWS, the most popular screen reading software on the market. The trial will run for 40 minutes at a time, and if you restart your computer, the counter will reset and you can use it again. It’s a pretty decent solution for software developers who want to test their work. It gets kind of annoying to wait while my messenger and email programs start every time I restart my computer, but it’s better than paying $900-$1100 for a full version of JAWS.
Testing JAWS with Flex
My first test of JAWS is with a simple Flex project with a single TabBar component. I turn on accessibility for the TabBar with the creationComplete event, and I give the it three tabs, “Web”, “Images”, and “Local” (like you might see on a search engine). I start up my browser, but the screen reader doesn’t have much to read.
Flash Movie Start. Flash Movie End.
It seems Flash Player doesn’t fully support accessibility within Firefox. Unfortunate. I wonder if it’s a browser problem or Adobe’s problem? Annoyed, but still open-minded, I ran the SWF in IE instead. JAWS gave me much more information, but I found some bugs with the component almost immediately. Here’s what JAWS read to me.
Flash Movie Start. Web Tab. Active Tab. Images Tab. Tab. Local Tab. Tab. Flash Movie End.
It says “Tab” twice for every Tab that it encounters. Navigating around tabs in native Windows applications doesn’t give me that problem. It’s not a big deal, but I definitely got a good first taste of unpolished accessibility features. Next, I start testing keyboard navigation. I press the Down arrow key.
Images Tab. Tab.
So far, so good. The “Images” tab has been highlighted, but not yet selected. I press the spacebar to select the tab.
Space.
Hmmm… did it work? I can see that it did because the Tab is now selected, but a blind user only knows that they pressed the spacebar. Maybe screen readers just automatically assume that the default action is successful. Sounds potentially confusing. I’d hate to be a blind developer with buggy code. I press the Up arrow key to go back to the “Web” tab.
Web Tab. Active Tab. Images Tab. Tab. Local Tab. Tab.
Uh oh. That seems wrong. First, the behavior has changed. Instead of simply telling me that the “Web” tab has been highlighted, JAWS has decided to read off the full contents of the TabBar again. Moreover, the TabBar has the “Images” tab selected now, but the screen reader is still reporting that the “Web” tab is active. That single bug is bad enough to make TabBar completely unusable to a blind user.
I tried testing a couple more components from Flash and Flex. The most potentially embarrassing for Adobe is that I can’t seem to figure out how to press Flash CS3’s Button component. I can use the Tab key or the Down arrow to navigate between them, and JAWS will read the labels, but the spacebar won’t press them. Also, in a Windows operating system dialog, the screen reader will say “To activate, press spacebar” when a button is highlighted. Why isn’t this more consistent?
My conclusion from several tests is that the official Flash and Flex components are hardly worthy of the title “accessible”. That’s only half the battle, unfortunately. Actually trying to build a custom component that supports screen readers is even more frustrating.
Implementing Accessibility
It didn’t take me long to discover that Adobe implements accessibility for their components differently than the officially suggested methods. Outlined on the Flash CS3 Accessibility pages (by comparison, the Flex accessibility information on Adobe’s site is completely out of date), accessibility should be handled through the Accessibility panel or with the “accessibilityProperties” property on DisplayObject. It is of type flash.accessibility.AccessibilityProperties. It seems pretty straightforward to use, but I haven’t played with it much yet. Why? Well, it’s because Adobe doesn’t use it for their components, and I want to handle accessibility the way they did it.
If you look in flash.accessibility.* package in the Flex 2 LiveDocs, you’ll see two classes, AccessibilityProperties and the main Accessibility class. You might also notice that the mx.accessibility.* package doesn’t get listed at all. This package contains the accessibility implementations for each of the Flex components, like Button, List, ComboBox, TabBar and everything else. Not a big deal, I guess, but now I have to dig into my file system and open these classes directly to learn more about them. When I started exploring this area, I discovered some very strange things.
The base accessibility class in Flex is named mx.accessibility.AccImpl. The equivalent in Flash CS3 is fl.accessibility.AccImpl. All the concrete implementations, like ButtonAccImpl for the Button component or TabBarAccImpl for TabBar, extend this class. Here’s where things get intersting: AccImpl itself extends another class named flash.accessibility.AccessibilityImplementation. “But wait,” the observant reader says, “I don’t remember seeing that class in the flash.accessibility.* package when I checked the LiveDocs.” Me either. This has led me to a lot of frustration because the functions from this class that get overridden in classes like ButtonAccImpl aren’t explained very well.
Adobe has chosen to hide what appears to be the most important class for implementing accessibility in components from the rest of world. Both the Flash CS3 components and the Flex components use this class, so it must be useful and important. Why isn’t it documented? Is there some reason why I wouldn’t want to use this class in my own component framework?
Much to my dismay, I also discovered the following comment from the source code for the Flash CS3 accessibility classes:
Nivesh says: I don’t think we should document the constructors for the accessibility classes.
The reason he says that is because the user of the class isn’t supposed to instantiate the accessibility implementations directly with the constructor. Instead, there’s a static enableAccessibility() function that needs to be called. Unfortunately, from that comment alone, I can’t help but wonder what other documentation is missing from these classes. In my opinion, the documentation for accessibility is the worst I’ve seen from Adobe, and after a week of messing with their stuff, I sent in a very long feature request for “extensive documentation”, and I gave up on one of my projects until I can spend a lot more time studying screen readers and Flash Player. Nivesh, please don’t remove anything that might be useful. Developers using ActionScript 3 will look closely at Adobe’s work to help pick up best practices and ideas, and you can bet that we want to know problems you run into and learn about things that we aren’t supposed to do. Document, document, document.
How Adobe can improve accessibility in Flash and Flex
-
Update the online documentation for Flex accessibility or remove it. Information for Flex 1.5 doesn’t help me much when Flex 3 is just around the corner.
-
Give me a walkthrough or two about how to make a real component accessible. Go through it step by step as if I’m an absolute novice. The fact is, most developers using any language or environment don’t know anything about accessibility. Include information on common problems we might encounter when trying to build accessible components. I’d love to see information about how to develop an accessible component that has subcomponents that are already accessible. What if I want to use their default behavior? What if I want to ignore the default behavior completely?
-
Adobe, if you’re going to use flash.accessibility.AccessibilityImplementation, you can bet that everyone else will want to use it too. Either stop hiding it, or stop using it because it’s not fair to us. Put this class in the documentation and describe it in detail. Walk through every single function available on this class, and explain exactly what these functions do, along with how and when they will be used by the screen reader.
-
Make accessibility subjects more visible in the documentation. At the very least, try to work the subject in more often. Developers don’t think of accessibility because we don’t encounter it often enough. For instance, for every component in Flex, there’s a page in the docs that offers a short introduction, it might have a bit of source code, and it describes how the component works. Is there a description of how each component appears to screen readers on those pages? There should be.
If you made it this far, thanks for listening to me vent. Accessibility is very important, and the need for it will only become more important in time as laws get stronger. Based on my short experience trying to make Flash and Flex components accessible, I’m a little embarrassed by the obviously untested components from Flex and the difficulties of setting it all up myself. I’m no accessibility expert, though, so please add comments below if you know of some good tricks that I may have missed, or if you have any insights about the undocumented AccessibilityImplementation class. I’d love to find links to good resources for Flash accessibility too. If you’re an Adobe employee, please make sure my comments go to the appropriate audience within the company. I’d love to see improvements based on my troubles. Thanks!