# Which Event is invoked on clicking the Close button of AIR Window

**URL:** <https://forum.kirupa.com/t/which-event-is-invoked-on-clicking-the-close-button-of-air-window/300485>\
**Category:** flash\
**Created:** [November 22, 2009, 7:51am UTC](https://forum.kirupa.com/t/which-event-is-invoked-on-clicking-the-close-button-of-air-window/300485 "2009-11-22T07:51:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raabi](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Raabi](https://forum.kirupa.com/u/Raabi)\
**Post date:** [November 22, 2009, 7:51am UTC](https://forum.kirupa.com/t/which-event-is-invoked-on-clicking-the-close-button-of-air-window/300485/1 "2009-11-22T07:51:53Z")

</div>

Hello

I am trying to capture the event; which is invoked when we close the **AIR** window by clicking its Close button (on the top-right corner). I have tried the following; but none of them seems invoked:

```auto
newWin.stage.addEventListener(Event.CLOSING, closeHandler);
newWin.stage.addEventListener(Event.EXITING, closeHandler);
newWin.stage.addEventListener(Event.REMOVED, closeHandler);
newWin.stage.addEventListener(Event.DEACTIVATE, closeHandler);
newWin.stage.addEventListener(Event.REMOVED_FROM_STAGE, closeHandler);

```

The code for the said problem is something like the following:

```auto
var initOptions: NativeWindowInitOptions = new NativeWindowInitOptions();
initOptions.systemChrome = NativeWindowSystemChrome.STANDARD;
var newWin: NativeWindow = new NativeWindow(initOptions);;
newWin.stage.addEventListener(Event.CLOSING, closeHandler);

```

Would anybody kindly help!
