Air Native 窗口活动窗口更改
我有一个有 2 个窗口的 Adobe Air 应用程序(AS3,不是 Flex)。当我从它们上单击到另一个桌面程序时,我收到一个“停用”事件(如您所料)。
当我点击 Window#1 时,我收到一个“激活”事件(如您所料)。
但是当我从 Window#1 转到 Window#2 时,我什么也没得到。我相信这是因为 Air 应用程序仍然是活动程序,只是一个不同的窗口。
但我需要知道何时从一个窗口转到另一个窗口。
到目前为止,我想出的可怕解决方案是使用 onEnterFrame
并检查当前窗口是否是活动窗口。但我更愿意用比这种黑客更好的方式来做这件事。
我已经完成了 Stage、NativeApplication 和 Native Window 事件,但它们都没有满足我的需要。谁能指出我可能忽略的另一个事件?
I have a Adobe Air app (AS3, not Flex) that has 2 windows. When I click away from them onto another desktop program, I get an "Deactivate" Event (as you would expect).
When I click on say Window#1 I get an "Activate" Event (as you would expect).
But when I go from Window#1 to Window#2, I get nothing. And I believe this is because the Air application is still the active program, Just a Different Window.
But I have the need to know when I go from 1 window to another.
The horrible solutions I have come up with so far is to have an onEnterFrame
and check if the current window is the active window. But I would much prefer to do it a much better way that such a hack.
I have gone though Stage
, NativeApplication
and Native Window
Events and none of them do what I need. Can anyone point me to another Event I may have overlooked?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
直接在 NativeWindow 对象上侦听窗口激活事件。 (所有显示对象都会调度激活/停用事件,但这些事件是由应用程序(或浏览器中的 SWF 对象)获得或失去操作系统焦点触发的。)
Listen for window activation events directly on the NativeWindow object. (All display objects dispatch activation/deactivation events, but these are triggered by the application -- or SWF object in the browser -- getting or losing the OS focus.)