Auto-close after new pop-up?

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.

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.

Hmm, I’m getting the following alert:

“This operation can only function within HTML Help”

Wha?

What browser?.. OS?

I tested before I uploaded, it worked fine.

Internet Explorer 6 SP 1

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 :stuck_out_tongue:

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

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.

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

http://windowsupdate.microsoft.com/

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…

hmm, OfficeXP working fine here after updating!

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…

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.

Oh well, thanks anyways.

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.

I understand :slight_smile:

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?

Anyone?

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…

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

Blah…figured. Thanks though.