# Detecting when user closes flash player to throw a method

**URL:** https://forum.kirupa.com/t/detecting-when-user-closes-flash-player-to-throw-a-method/245289
**Category:** flash
**Created:** [November 28, 2007, 10:27am UTC](https://forum.kirupa.com/t/detecting-when-user-closes-flash-player-to-throw-a-method/245289 "2007-11-28T10:27:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pmedina](https://avatars.discourse-cdn.com/v4/letter/p/eb8c5e/32.png) [@pmedina](https://forum.kirupa.com/u/pmedina)
#### Post date: [November 28, 2007, 10:27am UTC](https://forum.kirupa.com/t/detecting-when-user-closes-flash-player-to-throw-a-method/245289/1 "2007-11-28T10:27:51Z")

</div>

Hello buddies!

My question is pretty simple. There is a way to know when the user closes the flash player?  
I’m developing a “desk application” and i want to save the state of it by launching a method when the user exits the app. The method would update/create a XML file with the current state.

I’m pretty newbie with AS so I have no clue if thats possible. By the way, I’m coding with AS3.

Feedback appreciated!!!
