This content has been marked as final. Show 6 replies
Because a flex app runs in the Flash Player in the browser, you have to handle browser closing at the browser level. ExternalInterface can notify your flex app, IF you can intercept the browser closing event. IE has an "onBeforeUnload" (I think) event that you can use. I don't know FF or the other browsers well enough to have a suggestion.
Thanks. Even if FF has a similar event this approach can get complex as it will need to have a command for each type of browser and in some cases even versions of them.
I am thinking about another approach. Having a large (the width of the browser window) and thin invisible button (really transparent), that triggers an event when the user moves the mouse to the top of the browser window. The event will write on the XML file that the user is not be connected anymore. At the same time, it also triggers a timer (that will trigger another event after a couple of seconds) on the Flex app. that should write back to the XML that the user still connected.
Is not perfect, but could work.
Any other suggestions?
I would not do that, (sorry but its too hacky, there are too much variable things that can go wrong :
for example what if user closes browser with alt-f4?
or what if user just trying to move mouse to click on some other buttons on browser bar?
take a look at this :
ana also this example : http://flexapps.macromedia.com/labs/fabridge/samples/FABridgeSample.html
Thanks. I will experiment with the FABridge.