View Full Version : Auto-close after new pop-up?
AlienX1088
November 16th, 2002, 12:47 AM
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.
lostinbeta
November 16th, 2002, 02:49 AM
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.
h88
November 16th, 2002, 04:29 AM
Hmm, I'm getting the following alert:
"This operation can only function within HTML Help"
lostinbeta
November 16th, 2002, 04:30 AM
Wha?
What browser?... OS?
I tested before I uploaded, it worked fine.
h88
November 16th, 2002, 04:32 AM
Internet Explorer 6 SP 1
lostinbeta
November 16th, 2002, 04:40 AM
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 :P
h88
November 16th, 2002, 04:49 AM
Bah - I am not really keen on updating my OS, but that said, I'll have mine updated to SP2! :P
AlienX1088
November 16th, 2002, 12:19 PM
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.
h88
November 16th, 2002, 12:22 PM
You can simply update by following the instructions in the link.
http://windowsupdate.microsoft.com/
AlienX1088
November 16th, 2002, 12:34 PM
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..
h88
November 16th, 2002, 12:40 PM
hmm, OfficeXP working fine here after updating!
AlienX1088
November 16th, 2002, 12:49 PM
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..
lostinbeta
November 16th, 2002, 01:59 PM
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.
AlienX1088
November 16th, 2002, 02:05 PM
Oh well, thanks anyways.
lostinbeta
November 16th, 2002, 02:10 PM
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.
AlienX1088
November 16th, 2002, 02:16 PM
I understand :)
AlienX1088
November 16th, 2002, 02:49 PM
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?
AlienX1088
November 17th, 2002, 12:10 AM
Anyone?
lostinbeta
November 17th, 2002, 12:17 AM
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()")
}
AlienX1088
November 17th, 2002, 01:24 AM
Blah..figured. Thanks though.
AlienX1088
November 17th, 2002, 01:43 AM
Finally!! It turns out MS disabled that way of closing a window without asking because..well I dont know why..but I read something here (http://www.tek-tips.com/gviewthread.cfm/lev2/4/lev3/32/pid/216/qid/82344) that explains how to get around it. Thing is, I have no idea what they are talking about..the solution is near the end. Anyone want to explain?
lostinbeta
November 17th, 2002, 01:50 AM
If you read the whole thing you would have read that IE didn't disable this notification, they disabled the way to stop it.
I noticed the same OBJECT method was used that I used to prevent this. They said as of IE6 SP1, you will recieve an error because IE disabled this feature.
AlienX1088
November 17th, 2002, 01:56 AM
Okay, pardon my ignorance, but that means...?
lostinbeta
November 17th, 2002, 01:59 AM
Sorry, I am highly distracted tonight :(
That means that the method they use in that forum thread you showed me, was the same method I used in the .zip file earlier in this thread.
But as h88 and you recieved this error, it is because you have the latest build of the IE browser. My method of doing this has been disabled in the new IE browser build (IE6 SP1).
AlienX1088
November 17th, 2002, 02:01 AM
Oh..I see. Thanks for clearing that up..things go right over me sometimes. So basically there is no [known] way around this as of now? Oh well..it won't kill the visitor to manually close the window.
lostinbeta
November 17th, 2002, 02:05 AM
Nope, no known way right now. At least that I have found :(
Nah, most sites with a pop up have the user manually close the window, it is common practice.
AlienX1088
November 17th, 2002, 02:08 AM
Thanks again for all your help, I would have been pulling my hair out by now.
lostinbeta
November 17th, 2002, 02:13 AM
LOL, no problem :)
I probably would have too, I usually try to find any way possible to the solution, but I am just really out of it and distracted, and now that I know that the new IE doesn't support it, it saved me the trouble....lol.
Good luck with the rest of your site :)
radarguy
April 29th, 2005, 12:42 PM
I can't seem to find the file that you are talking about. I may be able to solve my problem with this.
Russ
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.
claudio
April 29th, 2005, 01:05 PM
The problem is that some of the forum attachments were lost once, due to a database problem.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.