Flex:如何确定 PopUpManager 窗口是否打开(或何时关闭)?
在 Flex (Flash Builder 4) 中,我通过 PopUpManager.addPopUp 打开一个新窗口。我的组件中有运行的计时器代码,我需要在该窗口打开时停止计时器,并在窗口关闭时再次启动计时器。
我认为在打开窗口的函数中停止计时器很容易,但是当窗口关闭时如何再次启动计时器?
有没有办法判断我的组件前面是否有弹出窗口,或者特定的弹出窗口是否仍然通过 PopUpManager 打开?
也许事件是更好的方法?
谢谢!
In Flex (Flash Builder 4) I am opening a new window via PopUpManager.addPopUp. I have timer code that runs in my component and I need to stop my timer when that window opens and start the timer again when the window closes.
I figure it's easy enough to stop the timer in the function that opens the window, but how can I start the timer again when the window closes?
Is there a way to tell if there is a pop-up window in front of my component, or if a specific pop-up window is still open via PopUpManager?
Maybe events are a better approach?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
活动!是要走的路。
发射/关闭期间的火灾事件。在事件处理程序中添加您的逻辑!
Events! is the way to go.
Fire events during launch/close. Add your logic in the event Handlers!
您可以使用以下代码来检查打开的弹出窗口是否被关闭。
如果它关闭,您可以停止计时器。
在您的计时器中,
现在您可以在打开弹出窗口时启动计时器。
You can use following code to check whether opened popup window is getting closed or not.
if it is closed you can stop the timer.
in your Timer,
Now you can start the Timer, when you opened the Popup window.
popupmanager是一个单例类,因此您可以轻松地知道使用他的ChildList创建了多少个弹出窗口
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/managers/PopUpManagerChildList.html
The popupmanager is a singleton class, so you can easily know how many popups have been created with his ChildList
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/managers/PopUpManagerChildList.html