FlashAid

Derek Featherstone knows a lot about JavaScript. He also knows a lot about accessibility. At this year’s South by Southwest conference, he sat on a panel called Web 2.1: Making Web 2.0 Accessible.

The audio for the panel is now available. I wish Derek could have hogged the microphone more: he clearly has tons of knowledge to share (but I guess it’s only fair that everyone else got the chance to speak too).

One of the things that Derek said — and seems almost heretical to say such a thing in the Web Standards community — is that Flash now has a lot of really good accessibility hooks… better than HTML in some ways. For instance, the Flash 8 player can detect the presence of a screen reader; something that is simply impossible to do using JavaScript alone (you can only detect the underlying user-agent, usually Internet Explorer).

After the panel, I was chatting with Stuart Langridge and Simon Willison who had also picked up on this point. We started talking about some way to make use of Flash to detect a screen reader and pass on that information to JavaScript. After all, one of the other newer features in Flash is the presence of a Flash/JavaScript bridge, allowing you to trigger JavaScript functions from a Flash movie. This would be enormously useful for Ajax applications which, as has been well documented, can have a lot of problems with screen readers.

I never followed up on the idea.

Fast forward to this past weekend. Simon was back in town to celebrate at the Clearleft one-year anniversary party. The day after the party, a bunch of us somewhat fragile feeling geeks gathered for a barbecue on Brighton beach. The idea of using Flash and JavaScript together came up once again. This time, Aral Balkan was there.

Within a day, he had knocked together FlashAid. It’s a small, 1 pixel by 1 pixel, .swf file that detects the presence of a screenreader and allows you to trigger JavaScript functions accordingly.

Aral has released it under the open source MIT license. As he says, this is a very early, proof-of-concept release. Now we can take it, test it, hack on it and improve it. If you’d like to help out, please join the mailing list.

I’ll be hanging out there. I’m hoping that I can help simplify the JavaScript, which I think will lower the barrier to entry and encourage more people to use this. Personally, I think it would be okay to have the Flash movie simply set a global variable to a Boolean value, depending on the presence of a screen reader (it wouldn’t pollute the global namespace anymore than creating a function or object, but it would be far simpler).

Right now, the implementation of FlashAid requires the presence of a div with a specific ID in the markup. It would be relatively straightforward to use some DOM Scripting to create and insert this div, rather than hard-coding it into the document.

I’m sure there’s plenty more that could be done, especially with testing, but it’s great that this idea is being explored.

Posted by Jeremy on Monday, July 3rd, 2006 at 4:14pm

Comments

Now this could really be interesting. I’d guess that my JavaScript currently isn’t up to helping out on this (it’s getting there), but this is something that could really help with the whole Web2.0/accessibility issue.

# Posted by Francis Storr on Monday, July 3rd, 2006 at 8:50pm

Actually you can talk from Flash to JavaScript in older versions too, but you might need some tricks to get it working.

# Posted by Mark Wubben on Monday, July 3rd, 2006 at 9:37pm

Yes, but can you also check screen reader’s presence in older versions of Flash?

# Posted by Marko on Tuesday, July 4th, 2006 at 6:25am

Do people with screenreaders even install flash?

# Posted by Ben on Tuesday, July 4th, 2006 at 7:15am

Let’s do some testing and find out.

# Posted by Jeremy Keith on Tuesday, July 4th, 2006 at 8:43am

What I’d personally like to see is a javascript environment variable that would describe accessibility preference of a user and would be set by him through browser preferences.

I think mild namespace polution is a small price to pay for this. It’s also simple enough, that I’m left pondering what downsides I must be missing, since this doesn’t exist yet.

# Posted by Marko on Tuesday, July 4th, 2006 at 10:59am

Hey Jeremy,

One of the main reasons I used a callback function is because of the asynchronous nature of the communication between the SWF and the page. Having a callback saves you from having to write code yourself to see if and when a global variable has come into existence. And, it’s very easy to set a global variable from the callback function if this is how you’d rather work. I guess we could add a second way of calling it whereby if you do not include the callback handlers, it does set a global variable for you if you feel this is going to be an important use case.

Also, the current version only tells you whether accesibility features are installed, not whether they are currently active. I’m going to improve it when I get a moment to add this feature too (I was going to but I read of some issues with this and I didn’t have enough time to test it so I left it out of the first release.)

Regarding writing the DIV by JavaScript: You can definitely do this but you’d lose the benefit of the current method which allows you to place alternative content in the DIV that displays by default. (This is all handled by the SWFObject script that embeds the Flash movie.) In other words, this is a feature not a bug :)

Looking forward to hearing your (and others’) feedback on this.

# Posted by Aral Balkan on Tuesday, July 4th, 2006 at 5:50pm

Hi; Could you please post a direct link to the FlashAid file, since the link you have here isn’t working. Thanks.

# Posted by Sam on Tuesday, July 4th, 2006 at 11:21pm

The link is working fine, Sam:

http://osflash.org/flashaid

# Posted by Jeremy Keith on Tuesday, July 4th, 2006 at 11:30pm

the current version only tells you whether accesibility features are installed, not whether they are currently active

Aral - I’m curious - what exactly are you checking for in the swf?

# Posted by Derek Featherstone on Wednesday, July 5th, 2006 at 3:42am

Ben asked "Do people with screenreaders even install flash?"

Did you install flash? Most likely it was preinstalled on your computer by the OS or browser (depending on your browser choice). It is exactly the same with screenreader user.

I saw Bob Regan (Macromedia now Adobe) accessibility evanglist give a demo on Flash accessibility a few years ago, and even then it was doing things I could not manage with HTML. The bad news at the time was you needed the lastest version of Flash and the lastest versions of the top flight screenreaders. A few years on, those products are now mainstream.

# Posted by Nick Cowie on Wednesday, July 5th, 2006 at 4:38am

Sorry. Comments are closed.

July 2006
SunMonTueWedThuFriSat
      1
2345678
9101112131415
16171819202122
23242526272829
3031     

Recommended Reading

XML Subscribe

Grab the RSS feed for this blog.

JavaScript API

Grab the RSS feed of comments for this entry.