flex swf app - looking for unload() or onClosing() exiting() function

一个人想着一个人 提交于 2019-12-10 22:41:03

问题


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)

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

Thanks


回答1:


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.



来源:https://stackoverflow.com/questions/4501954/flex-swf-app-looking-for-unload-or-onclosing-exiting-function

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