# Auto-close after new pop-up?

**URL:** <https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226>\
**Category:** flash\
**Created:** [November 16, 2002, 4:47am UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226 "2002-11-16T04:47:59Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlienX1088](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@AlienX1088](https://forum.kirupa.com/u/AlienX1088)\
**Post date:** [November 16, 2002, 4:47am UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/1 "2002-11-16T04:47:59Z")

</div>

Hi! First of all I want to thank Kirupa for writting the tutorials, they are very easy to follow! Now, I was wondering if there is a way for the parent window to automatically close after a pop-up. I made it so that when they click on the mouse ((mouse down function)), a new page opens on the same window, but I want it so that a new page opens in a new window, AND tha parent window closes. Is that possibble? Thanks in advanced.

---

<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:** [November 16, 2002, 6:49am UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/2 "2002-11-16T06:49:22Z")

</div>

It is possible.

I have attached a file here to show you how it is done. I did this file for someone else who needed to know. I added in a few extra things to keep it from popping up the alert message asking if you are sure you want to close this window for him. So with that said, Be sure to have the script and object in between the head tags of your html page. The object is important in a way that this is what prevents IE from asking if you are sure you want to close. You will see what I mean when you open the HTML file.

The links in here are done in HTML, but you can always call them in Flash with a getURL action the same way.

---

<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:** [November 16, 2002, 8:29am UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/3 "2002-11-16T08:29:07Z")

</div>

Hmm, I’m getting the following alert:

“This operation can only function within HTML Help”

---

<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:** [November 16, 2002, 8:30am UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/4 "2002-11-16T08:30:07Z")

</div>

Wha?

What browser?.. OS?

I tested before I uploaded, it worked fine.

---

<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:** [November 16, 2002, 8:32am UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/5 "2002-11-16T08:32:30Z")

</div>

Internet Explorer 6 SP 1

---

<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:** [November 16, 2002, 8:40am UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/6 "2002-11-16T08:40:05Z")

</div>

I am using IE6… hmm, I don’t see why it would be different in SP1.

It worked for the guy I wrote it for too (Revv).

Hmmmmm, could be just you 😛

---

<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:** [November 16, 2002, 8:49am UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/7 "2002-11-16T08:49:15Z")

</div>

Bah - I am not really keen on updating my OS, but that said, I’ll have mine updated to SP2! 😛

---

<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:** [November 16, 2002, 4:19pm UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/8 "2002-11-16T16:19:58Z")

</div>

Thanks for the file, but I get the same problem as he does…“This operation can only function within HTML help” I am using WindowsXP ((no SP)) and IE 6, again, no SP.

---

<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:** [November 16, 2002, 4:22pm UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/9 "2002-11-16T16:22:00Z")

</div>

You can simply update by following the instructions in the link.

[http://windowsupdate.microsoft.com/](http://windowsupdate.microsoft.com/)

---

<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:** [November 16, 2002, 4:34pm UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/10 "2002-11-16T16:34:11Z")

</div>

Is that gonna help though? I mean…I don’t want to install the windows SP because it conflicts with OfficeXP and makes it crash whenever I open a file…

---

<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:** [November 16, 2002, 4:40pm UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/11 "2002-11-16T16:40:05Z")

</div>

hmm, OfficeXP working fine here after updating!

---

<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:** [November 16, 2002, 4:49pm UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/12 "2002-11-16T16:49:51Z")

</div>

I think I’m the only one with the problem, but anyways, I still get the same error in the html file after the SP1 update. I wonder what it could be…

---

<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:** [November 16, 2002, 5:59pm UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/13 "2002-11-16T17:59:17Z")

</div>

Hrm, I use Win XP no SP version.

and IE 6 (not IE 6 SP1)

Works fine for me. Oh well, if it doesn’t work on your side, but works on my side, it will be incredibly hard for me to write a script that works for me and know if it works for you… soooo…

Someone else will have to help you here then.

---

<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:** [November 16, 2002, 6:05pm UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/14 "2002-11-16T18:05:06Z")

</div>

Oh well, thanks anyways.

---

<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:** [November 16, 2002, 6:10pm UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/15 "2002-11-16T18:10:24Z")

</div>

Sorry I couldn’t be of more help, but if I don’t know what the exact problem is and what is causing it, it is very hard for me to troubleshoot the situation.

---

<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:** [November 16, 2002, 6:16pm UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/16 "2002-11-16T18:16:27Z")

</div>

I understand 🙂

---

<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:** [November 16, 2002, 6:49pm UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/17 "2002-11-16T18:49:35Z")

</div>

Hmm…is it possible to insert a command so that when they click on a button the parent window closes? Like OnMouseDown the new windows opens and OnMouseRelease the parent window closes…? Or am I just totally crazy?

---

<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:** [November 17, 2002, 4:10am UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/18 "2002-11-17T04:10:28Z")

</div>

Anyone?

---

<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:** [November 17, 2002, 4:17am UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/19 "2002-11-17T04:17:41Z")

</div>

You can do that, but you will get a message popping up saying “Are you sure you want to close this window?”.

If you want to do it it would look something like…

```auto
on (press){
getURL("yournewwindowcode")
getURL("javascript:close()")
}

```

---

<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:** [November 17, 2002, 5:24am UTC](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226/20 "2002-11-17T05:24:00Z")

</div>

Blah…figured. Thanks though.

[Next page](https://forum.kirupa.com/t/auto-close-after-new-pop-up/8226.md?page=2)
