I have a live collaborative Flash site, where promptly detecting if users leave (close their browser window) is quite important.
I've tried using the Javascript onbeforeunload() handler to send a message to the Flash movie telling it to disconnect, but there's a catch:
It only works if I show an "Are you sure you want to close?" type alert. If the window closes straight away without an alert, that disconnect message is never sent by the Flash movie. I know delaying the window close is poor practice, but is there any way to do so, even for a fraction of a second, which would be enough for Flash to send an "I'm disconnecting" message?
I've tried using the Javascript onbeforeunload() handler to send a message to the Flash movie telling it to disconnect, but there's a catch:
It only works if I show an "Are you sure you want to close?" type alert. If the window closes straight away without an alert, that disconnect message is never sent by the Flash movie. I know delaying the window close is poor practice, but is there any way to do so, even for a fraction of a second, which would be enough for Flash to send an "I'm disconnecting" message?