Skip to main content
June 9, 2006
Answered

_root.onQuit Event?

Is there and event that occurs when the user presses the page refresh and the current swf stops playing.
This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer
June 9, 2006
Interesting question. I don't know to be honest, but I don't think that the flash object finds out when it's unloaded.
There is however a window.onbeforeunload event in the browser, so you can catch that with javascript and tell Flash what to do.

5 replies

June 9, 2006
I'll give that a try. I need to learn more about communicating between flash and javascript anyway. Thanks.
Translate
2m91_2
Inspiring
June 9, 2006
Internaly there has to be something like that, because localShared objects are automaticaly flushed at that moment (it's said not to rely on that but I can't remember a case when it wouldn't work as advertised)

As the swf is gone anyway, the usefullness would be limeded to storing info (I'm probably missing something though) and perhaps the functinality of the LSO is something that can help you?
Translate
June 10, 2006
I have tried to use _root.onUnload and that didn't seem to do it. I was reading the help this morning and this is what is said about the MovieClip.onUnload "Event handler; invoked in the first frame after the movie clip is removed from the Timeline". If it's invoked the first frame after the movie clip is removed then this event must only be for MovieClips that are added to the main timeline, because if the _root is removed then there will be no next frame...Right?
Translate
Correct answer
June 9, 2006
Interesting question. I don't know to be honest, but I don't think that the flash object finds out when it's unloaded.
There is however a window.onbeforeunload event in the browser, so you can catch that with javascript and tell Flash what to do.
Translate