# Close browser window from within .swf

**URL:** <https://forum.kirupa.com/t/close-browser-window-from-within-swf/265391>\
**Category:** flash\
**Created:** [July 8, 2008, 2:01pm UTC](https://forum.kirupa.com/t/close-browser-window-from-within-swf/265391 "2008-07-08T14:01:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinceg241](https://avatars.discourse-cdn.com/v4/letter/v/d07c76/32.png) [@vinceg241](https://forum.kirupa.com/u/vinceg241)\
**Post date:** [July 8, 2008, 2:01pm UTC](https://forum.kirupa.com/t/close-browser-window-from-within-swf/265391/1 "2008-07-08T14:01:39Z")

</div>

Hello To All:  
I’m a newbie to Kirupa, and a light-weight with Flash,  
but with some success so far.  
I’m stuck on trying to close the browser window from within my .swf file.  
Have tried:  
on (press) {  
getURL(“javascript:window.close();”, “\_self”);  
}  
and  
on (press) {  
getURL(“javascript:window.close();”);  
}  
and lots of variations on this code, but nothing works.

The application is an .swf which contains a ‘loadMovie’ button  
to daisy-chain to the next file. (Travelling thru China)  
I want to add a button which will close the browser window  
which I opened originally from an .html page.  
I’ve been at it for about a day and a half, with no luck.  
I’m sure it’s something I’ve overlooked, and appreciate any help.  
Thanks,  
Vince G.
