Firefox Focus and Actual Links
I mentioned at the TPG Webinar on Flash that there is a way around the issues with focus trapping in Firefox. My friend and accessibility-colleague Michael Jordan has developed a simple example that shows how to get focus in and out of Flash content in Firefox (using the SWFFocus class). Also in this example he shows how to make links that are not buttons, but use the MSAA link role. This has always been possible, but usually people use the button role.
Give this a try and let us know if it works for you or if you have any suggestions for improvements.
Comments
Hi,
I just downloaded the zip and opened the index.html into my browser directly from my local disk (not through a web server, that is). The Flash object is oddly displayed in Firefox (v3.0.9, with the Flash plugin labelled version 10.0 r12). All the links are set in the top left corner of the page, overlapping each other. They can be tabbed through, but it does not seem fit for showing around. That's a shame since I was about to pass the news from my blog!
In IE6 it works fine though (but is of little interest to me since my main concern currently is the focus-trapping issue in FF). The plugin information given indicates that it's Flash 10 as well (Flash10a.ocx).
Thanks in advance for this.
Posted by: Olivier | April 29, 2009 06:08 AM
Tk Andrew. Example have some rendering problem in Firefox, but work!
Posted by: Livio | April 29, 2009 06:26 AM
Wow... I've been looking for a solution for this for years. I've always resorted to creating my controls in HTML outside of Flash.
Posted by: Tom H | April 29, 2009 09:42 AM
@Olivier
The ActionScript on Frame 1 of the AccLinkExample.fla first creates the AccLinkButton instances on the stage. Then, it initializes SWFFocus by calling SWFFocus.init(stage). Finally, it positions the links by calling onResize().
The SWFFocus class uses ExternalInterface to call JavaScript, which writes the links and a script tag to the DOM in index.html.
When testing locally and not on a web server, you must explicitly allow the directory that contains index.html using the Global Security Settings Panel at http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html or the FlashPlayer will catch a security-sandbox violation error when it tries to make the ExternalInterface call.
Since the onResize() method is being called after the SWFFocus.init(stage) call and security-sandbox violation, the links never get repositioned.
Cheers,
Michael
Posted by: Michael Jordan | April 29, 2009 11:22 AM
Thanks Michael. I also posted the example live in case people want to try it without changing their settings to allow scripting locally. I added a link to the blog post above.
Posted by: Andrew Kirkpatrick | April 29, 2009 11:32 AM