•  
  •  

Adobe Flash and Flex Accessibility with Screen Readers

If you are dealing with 508 compliance and wondering if a Flex application is accessible, this is your post.

First, yes, screen readers can read Flex applications. And yes, its fairly easy. But, I’ll discuss how in a future post.

But, if you’d rather send people to your old HTML version of your site when using a read, there is good news. Flash Player has the ability to detect if a screen reader is running on the client machine, even if JavaScript is disabled and/or the Flex application is not compiled as an “accessible swf”. This is possible with the Accessibility class.

It is important to note that if the Flex application is compiled as an “accessible swf”, the screen reader will also be able to read content in the swf. If not, the screen reader only reads the words “flash movie start” whenever you interact with it. Talk about a usability buzz kill.

So, here is the code to see if a screen reader is currently running (not just installed) and then adds a LinkButton that calls a navigateToURL on click.

private function init():void
{
  // this is the only thing you need to do
  if( Accessibility.active )
  {
    var linkButton:LinkButton = new LinkButton();
    linkButton.label = "Click here to go to HTML site";
    linkButton.addEventListener( MouseEvent.CLICK, goToSite );
    this.addChildAt( linkButton, 0 );
  }
}

private function goToSite( eventObj:MouseEvent ):void
{
  navigateToURL( new URLRequest("<screen reader friendly site>") );
}

There are more properties available on the Accessibility class, but this is all you need to give accessibility an option.