# onExit event?

**URL:** https://forum.kirupa.com/t/onexit-event/60711
**Category:** flash
**Created:** [August 11, 2004, 9:53pm UTC](https://forum.kirupa.com/t/onexit-event/60711 "2004-08-11T21:53:03Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jerez\_z](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@jerez\_z](https://forum.kirupa.com/u/jerez_z)
#### Post date: [August 11, 2004, 9:53pm UTC](https://forum.kirupa.com/t/onexit-event/60711/1 "2004-08-11T21:53:03Z")

</div>

Is there an event that IU can assign a function that is called when an swf closes? (say they click the close button of the internet explorer window) Cause that would be sweet.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 11, 2004, 9:58pm UTC](https://forum.kirupa.com/t/onexit-event/60711/2 "2004-08-11T21:58:10Z")

</div>

onUnload  
in javascript is \<body onUnload=“javascript: …”\>  
in flash is \_root.onUnload = function() { … }

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 11, 2004, 10:32pm UTC](https://forum.kirupa.com/t/onexit-event/60711/3 "2004-08-11T22:32:40Z")

</div>

ok but I hoping for something in Actionscript. Does it exist?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 11, 2004, 10:36pm UTC](https://forum.kirupa.com/t/onexit-event/60711/4 "2004-08-11T22:36:55Z")

</div>

nope

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 11, 2004, 10:39pm UTC](https://forum.kirupa.com/t/onexit-event/60711/5 "2004-08-11T22:39:18Z")

</div>

You can embed the swf in an HTML page (which you should do anyway) and assign the onExit action to the window with javascript

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 12, 2004, 1:39pm UTC](https://forum.kirupa.com/t/onexit-event/60711/6 "2004-08-12T13:39:09Z")

</div>

hmmmm… well that just kinda sucks. Maybe I can work around it.
