title: Flash/AS3 "Shutdown" or "close" event?
body: <p>I am making a Flash puzzle game. When the user loads the game, it needs to ask whether to resume the game from the last state (if it exists). I have a serialization system in place, but I need to ensure that the loaded state is definitely the last state.</p>
  
  <p>One solution is to save the state to a <code>SharedObject</code> every time the state changes (when the player makes a move). However, the game state sometimes includes a countdown, so I'd have to be constantly (or periodically) saving the state in order to retain it. I guess this is acceptable, but it seems kludgey.</p>
  
  <p>Is there any event which is fired when the swf is closed? Or anyone else have another elegant solution to this?</p>
  
  <p>(I'm not using AIR, but solutions requiring AIR are appreciated.)</p>
  
  <p>Edit: Another important point is that I may not have control over the embedding HTML for the game, as it may be syndicated to many sites. So solutions involving javascript aren't ideal.</p>