本文介绍了柔性SWF应用程序 - 寻找卸载()或onClosing()退出()函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我上传我的Flex客户端的SWF应用程序的一些网站上加载不同瑞士法郎的它的网站。所以你看你的应用程序漂浮在该网站上。我的应用程序是Flex的SWF应用程序,并拥有onCreationComplete()启动逻辑流。现在,我想要做的清理工作状态,并保存状态在共享对象,当应用程序卸载(或者可能退出事件,或关闭事件。)那么,我们有什么功能,我可以实现和Flash平台会自动调用该函数时, SWF正在卸载/关闭/退出? (就像onCreationComplet()函数)

I upload my flex client-side swf app to some website that loads different swf's on it's site. So you see your application floating in that website. My app is Flex swf app and has onCreationComplete() that starts the flow of logic. Now I want to do cleanup state and save state in a shared object when the application unloads (or probably exiting event, or closing event..) So do we have any function that I can implement and the flash platform automatically calls that function when the swf is unloading/closing/exiting?? (just like the onCreationComplet() function)

一些事情一样onUnloading(),或onUnload()或onClosing()...

some thing like onUnloading(), or onUnload() or onClosing()...

感谢

推荐答案

您可以添加一个事件监听到你的主目录(根)对象,并有你的方法上执行 Event.REMOVED_FROM_STAGE 或监听器添加到root.loaderInfo和的。

You could add an event listener to your main (root) object and have your method execute on Event.REMOVED_FROM_STAGE or add the listener to root.loaderInfo and execute on Event.UNLOAD.

这篇关于柔性SWF应用程序 - 寻找卸载()或onClosing()退出()函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 20:35