如何检查如果SWF已聚焦在AS3SWF

2023-09-08 15:10:13 作者:荒途旅人

我只是认为这将是有益知道如何检查,如果主权财富基金已经集中或以其他方式。当最终用户的阶段点击外侧(在浏览器的地址栏,例如)出现这种情况。

解决方案

  stage.addEventListener(Event.DEACTIVATE,notFocused);
stage.addEventListener(Event.ACTIVATE,集中);
功能notFocused(五:事件){
    跟踪(不集中);
}
功能重点(五:事件){
    跟踪(聚焦);
}
 

I just thought it would be useful to know how to check if an swf has been focused or otherwise. This situation arises when the end user clicks outside of the stage (on the address bar of the browser, for example).

解决方案 全聚焦 vs 常规相控阵 PAUT 之检测原理比较

stage.addEventListener(Event.DEACTIVATE, notFocused);
stage.addEventListener(Event.ACTIVATE, focused);
function notFocused(e:Event) {
    trace("Not focused");
}
function focused(e:Event) {
    trace("Focused");
} 

 
精彩推荐
图片推荐