In some of application user directly close the browser or tab of that browser, in this case we need to maintain or manipulate or save some data as per the requirement. In flex there is no direct option that detect the browser or tab close event.
Solution
Using JavaScript and Flex's ExternalInterface we can able to detect the close event of the browser or tab. when ever tab or browser close than 'onunload' event of body of that page called, in that method we call the method of swf(Flex object) which already listen the function using ExternalInterface in flex side.So when ever unload event occur it called flex actionscript method as in register in ExternalInterface addCallback method.
Detailed explanation
In Flex side we simple register method name with its function which is called by the javascript, on unload event of body.