# Auto close browser window

**URL:** <https://forum.kirupa.com/t/auto-close-browser-window/20488>\
**Category:** flash\
**Created:** [May 9, 2003, 4:02am UTC](https://forum.kirupa.com/t/auto-close-browser-window/20488 "2003-05-09T04:02:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ck3lam](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@ck3lam](https://forum.kirupa.com/u/ck3lam)\
**Post date:** [May 9, 2003, 4:02am UTC](https://forum.kirupa.com/t/auto-close-browser-window/20488/1 "2003-05-09T04:02:44Z")

</div>

Sorry to bring this old topic again…  
I wanna close my current(main) browser when a new pop up  
browser appears,i found this code in html:

```php
<object id=closeWin type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"> <param name="Command" value="Close">

```

but i’m wondering what should i put the code in the flash?  
Thanks a lot!

By the way, is that a way I click on the browser(main browser)  
and it has no status bar,directories,menu bar and so on…?  
Something like a pop up window. I found how to create a pop up but how can it be down in the main browser…

Thanks again

---

<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:** [May 9, 2003, 1:32pm UTC](https://forum.kirupa.com/t/auto-close-browser-window/20488/2 "2003-05-09T13:32:46Z")

</div>

Full screen mode.

Lost in Beta posted this link - you might want to search the forum to see his comments about this subject.

[http://www.dynamicdrive.com/dynamicindex8/window1.htm](http://www.dynamicdrive.com/dynamicindex8/window1.htm)

not sure about the auto close…

TD

---

<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:** [May 9, 2003, 1:38pm UTC](https://forum.kirupa.com/t/auto-close-browser-window/20488/3 "2003-05-09T13:38:18Z")

</div>

hmm… dunno about the code you posted, but if you want to do it in Flash all you need is this:

```auto

getURL("j avascript:window.close();");

```

(without the space in ‘j avascript’ wouldn’t display the word properly in this post if i didn’t have the space for some reason)

note that unless the window has been opended by your site using javascript you’ll be asked if you want to close the window when this code is executed. As far as I know there isn’t a way around this

---

<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:** [May 9, 2003, 5:02pm UTC](https://forum.kirupa.com/t/auto-close-browser-window/20488/4 "2003-05-09T17:02:19Z")

</div>

if you are using the active-x method of closing to window to prevent the “Are you sure you want to close” alert from popping up, then don’t waste your time. As of the newest IE version, IE took out the methods of preventing that alert ☹ They claim it is a “security risk”, but I doubt thats true.

---

<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:** [May 10, 2003, 11:25am UTC](https://forum.kirupa.com/t/auto-close-browser-window/20488/5 "2003-05-10T11:25:44Z")

</div>

actually i found this code in this forum  
[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=5236](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=5236)  
I clicked on the link that Craig gave.It works without any dialog  
box appears! But how do i do it with flash? What should I write  
in flash. He didn’t state it in clear. Can someone helps me answer it?  
Thanx a lot

---

<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:** [May 10, 2003, 5:10pm UTC](https://forum.kirupa.com/t/auto-close-browser-window/20488/6 "2003-05-10T17:10:08Z")

</div>

Well if you notice in the .zip file it only gives files for IE4 and IE5, thats because IE6 no longer supports the method.

But if you insist… since it is an activeX object the code doesn’t go in Flash, it goes inside your .html file.

And you can call it in Flash with this…

[AS]on (release){  
getURL(“java\*\*script:closeWin.Click();”, “\_self”);  
}[/AS]

In theory that should work.
