December 29th, 1999, 02:02 PM
Okay somebody out there must know how to do this. I have a script to open a new window, nothing overly difficult. But than I would like to open another one off the Flash File. If the user leaves the first open the new one goes in there and it does not use the proper variables to size the window. Is there a way to close a window from outside the window (by naming it or whatever) so that when I click on another link it opens a totally new one ? I have been told that there is a script that closes one window before opening another, anyone that can help me ?
December 29th, 1999, 03:50 PM
If I understand you correctly, you have a browser open, you click a link and want a new window to open, you then click another link to open a third window(including browser) then you want to close the second window. The problem you are having is that the page you want to come up in the third window is coming up in the second. If this is the case, when you open the third window, specify a different name as you thought. To close the second window that called the third window, use the following:
If this doesn't work, let me know.
December 30th, 1999, 08:15 AM
Thanks for the help, but I am a little confused. Does the code go in the HEAD of the original browser window or in the second one ? and if it goes in the first how do you call on the function ?
January 4th, 2000, 08:09 AM
You can't close the window that is going to open the new window because it will never process the code to open the new window. You can try two things: First you can open the new window, then at the end of your program do a window.close or self.close (this code will go in the window that you want to close) or you can open the new window and the first piece of code that will be processed is the code that I sent earlier. Just remember that the computer processes code from the top going down. You have to open the new window before you can close the window that is calling the new window.
If you do it the second way: open the new window as you normally would (name it differently), then put the code snippet that I sent you in the head of the most recently opened window. (the last one opened) That way, the first thing that will happen in the newest window will be to close the window that called the newest window.