check for system focus

蓝咒 提交于 2019-12-12 03:05:58

问题


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


回答1:


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 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.



来源:https://stackoverflow.com/questions/8138105/check-for-system-focus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!