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

2019-07-20 12:05发布

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条回答
Deceive 欺骗
2楼-- · 2019-07-20 13:09

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.

查看更多
登录 后发表回答