How to detect for screenreaders/MSAA without focusing the flash movie?
- by utt73
I am trying to detect for the presence of assistive technology using flash. When a Flash movie holding the actionscript below on frame 1 is loaded (and screenreader chatting to IE or Firefox over MSAA is active -- JAWS or NVDA), Accessibility.isActive() does not return "true" until the movie is focused. Well, actually not until some "event" happens. The movie will just sit there until I right-click it & show flash player's context menu... it seems only then Accessibility.isActive() returns true. Right-clicking is the only way I could get the movie to "wake up".
How do I get the movie to react on it's own and detect MSAA? I've tried sending focus to it with Javascript... can a fake a right-click in javascript or actionscript? Or do you know the events a right click is firing in a flash movie -- possibly I can programatically make that event happen?
My Actionscript:
var x = 0;
//check if Microsoft Active Accessibility (MSAA) is active.
//Setting takes 1-2 seconds to detect -- hence the setTimeout loop.
function check508(){
if ( Accessibility.isActive() ) {
//remove this later... just visual for testing
logo.glogo.logotext.nextFrame();
//tell the page's javascript this is a 508 user
getURL("javascript:setAccessible();")
} else if (x<100) {
trace ("There is currently no active accessibility aid. Attempt " + x);
x++;
setTimeout(check508,200);
}
}
/*
//FYI: only checks if browser can talk to MSAA, not that it is actually running. Sigh.
if (System.capabilities.hasAccessibility) {
logo.glogo.logotext.nextFrame();
getURL("javascript:setAccessible();")
};
*/
check508();
stop();
My HTML:
<embed id="detector" width="220" height="100" quality="high" wmode="window" type="application/x-shockwave-flash" src="/images/detect.swf" pluginspage="http://www.adobe.com/go/getflashplayer" flashvars="">