检查系统焦点 [英] check for system focus

查看:29
本文介绍了检查系统焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于主应用程序的激活和停用事件处理程序,当用户在浏览器或 flex 应用程序浏览器窗口内部或外部单击时触发.由于我对我的应用程序进行了一些细微的更改(我怀疑 Adob​​e 无法预见)激活和停用事件不再被触发.例如,是否有我可以在 enterFrame 中调用的 hasFocus 类型函数

I have an activate and deactivate event handlers for the main Application that trigger when the user clicks inside or outside the browser or flex application browser window. Due to some subtle changes I made to my app (I suspect unforeseen by Adobe) activate and deactivate events are no longer triggered. Is there a hasFocus type function I can call instead in enterFrame for example

推荐答案

我建议在 JavaScript 中添加事件处理程序监听焦点 &Flash DOM 对象的模糊事件.如果其中任何一个事件触发,您可以通过 externalInterface 通知 Flash 影片并根据需要对其进行处理.

I'd suggest adding event handlers in JavaScript listening to the focus & blur events of the Flash DOM object. If either of these events fires, via externalInterface you can inform the Flash movie and handle it as desired.

当鼠标离开舞台时,Flash 有一个 Event.ACTIVATE 事件和一个 MOUSE_OUT 鼠标事件,但它们并不总是非常准确.MOUSE_OUT 事件,特别是,如果您在向外拖动时按住鼠标按钮,则不会触发.真的,JavaScript 是这里最好的选择.

Flash has an event for Event.ACTIVATE and a MOUSE_OUT mouse event when the mouse leaves the stage, but they're not always very accurate. The MOUSE_OUT event, in particular, won't fire if you're holding down a mouse button as you drag outside. Really, JavaScript is the best bet here.

这篇关于检查系统焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆