0

我正在尝试使用 flash 检测辅助技术的存在。当 Flash 电影在第 1 帧上加载了下面的动作脚本时(并且屏幕阅读器通过 MSAA 与 IE 或 Firefox 聊天是活动的——JAWS 或 NVDA),Accessibility.isActive()在电影获得焦点之前不会返回“true”。好吧,实际上直到一些“事件”发生。电影只会坐在那里,直到我右键单击它并显示 Flash 播放器的上下文菜单......似乎只有这样才会Accessibility.isActive()返回 true。右键单击是我可以让电影“唤醒”的唯一方法。

如何让电影自行做出反应并检测 MSAA?我已经尝试使用 Javascript 将焦点发送到它...可以在 javascript 或 actionscript 中伪造右键单击吗?或者您是否知道在 Flash 电影中右键单击触发的事件——也许我可以通过编程方式使该事件发生?

我的动作脚本:

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 is MSAA compliant, not that A.T. is actually running. Sigh.  
//This returns true immediately though.  
if (System.capabilities.hasAccessibility) {  
    logo.glogo.logotext.nextFrame();  
    getURL("javascript:setAccessible();")  
};  
*/  
check508();  
stop();  

我的 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="">
4

1 回答 1

0

基于this stackoverflow answer,我找到了一个解决方案:

var fl = document.getElementById("detector"); 
    if (fl) { 
        fl.focus();
    }

它必须是纯 javascript,如上所述,附加到您的window.load事件。尝试使用 jQuery 选择器$("#detector").focus()或省略 if 语句并仅使用document.getElementById("detector").focus() ...both 都不起作用

然后,我在 HTML 页面的 Javascript 中将焦点发送回我的setAccessible()函数中的页面顶部,这样 AT 用户就不会在页面加载时专注于 Flash 电影。

于 2010-05-30T00:09:08.937 回答