views:

38

answers:

1

Hi Guys,

anybody knows how to make event listener for flash exiting?

By mean exiting is when a tag that hold the flash object is removed so that you cant see the flash anymore...

Thanks

+1  A: 

If you mean an event that gets fired upon flash destruction (web page closing, user navigating away from the page, exiting the browser or things like that), there's no help. Flash has no idea that it is about to be killed, can't signal about it, and surely can't to anything to delay/prevent the situation.

If the problem you're having is your server not knowing when your flash app is unloaded/exited then the only solution, as far as I know, is to set up a session with the server and wait for it to time out when flash dies. If you need finer control over it, you can also incorporate a 'heartbeat' into your app (flash calls the server in regular intervals so the server knows the flash instance is still alive).

As far as elegant/easy solutions, I haven't seen any. Sure would like to know of some. ;-)

jpop
ah... Thanks for the info... I think the heartbeat is the best solution...