# onExit event?

**URL:** https://forum.kirupa.com/t/onexit-event/119146
**Category:** Uncategorized
**Created:** [August 11, 2004, 9:53pm UTC](https://forum.kirupa.com/t/onexit-event/119146 "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/119146/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: ![Dulcinea](https://avatars.discourse-cdn.com/v4/letter/d/bbe5ce/32.png) [@Dulcinea](https://forum.kirupa.com/u/Dulcinea)
#### Post date: [August 11, 2004, 9:58pm UTC](https://forum.kirupa.com/t/onexit-event/119146/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: ![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, 10:32pm UTC](https://forum.kirupa.com/t/onexit-event/119146/3 "2004-08-11T22:32:40Z")

</div>

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

---

<div class="post-metadata">

### Author: ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)
#### Post date: [August 11, 2004, 10:36pm UTC](https://forum.kirupa.com/t/onexit-event/119146/4 "2004-08-11T22:36:55Z")

</div>

nope

---

<div class="post-metadata">

### Author: ![ahmed](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@ahmed](https://forum.kirupa.com/u/ahmed)
#### Post date: [August 11, 2004, 10:39pm UTC](https://forum.kirupa.com/t/onexit-event/119146/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: ![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 12, 2004, 1:39pm UTC](https://forum.kirupa.com/t/onexit-event/119146/6 "2004-08-12T13:39:09Z")

</div>

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