Flash Application exit

Dear Reader
I have one question in the flash.
I am developing the Flash Application. It’s web based application.
User running the Flash SWF file in the browser. Suppose that user suddenly close the browser like (Power cut, Alt+f4, or click browser close button, ect., ).
That time i need flash swf file fire the one function like windowclosing() like that its possible or not in Flash . Pls help me.
Regards
sathish