# Close the browser window by fl button

**URL:** <https://forum.kirupa.com/t/close-the-browser-window-by-fl-button/295027>\
**Category:** flash\
**Created:** [August 24, 2009, 2:24pm UTC](https://forum.kirupa.com/t/close-the-browser-window-by-fl-button/295027 "2009-08-24T14:24:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eagle1](https://avatars.discourse-cdn.com/v4/letter/e/eb8c5e/32.png) [@Eagle1](https://forum.kirupa.com/u/Eagle1)\
**Post date:** [August 24, 2009, 2:24pm UTC](https://forum.kirupa.com/t/close-the-browser-window-by-fl-button/295027/1 "2009-08-24T14:24:48Z")

</div>

Hello everyone !

I have my game in a browser window (incredible !).

I put a red cross in top of my game and want that it close the window.

I’m using the following code :

```auto

close_btn.addEventListener(MouseEvent.CLICK,close_window);

function close_window(evt:MouseEvent)
{
    ExternalInterface.call("window.close()");
}

```

and the js console answer :  
Scripts may not close windows that were not opened by script.

any trick ?  
thank you !
