Groups | Blog | Home
all groups > flash actionscript > january 2004 >

flash actionscript : Close Browser and Change URL - HELP!


design_guy
1/29/2004 9:50:33 PM
Hi all,

Here's my situation:

I have a URL with a link that:

1. Opens a new browser window, in which reside an SWF movie.
2. At the end of the movie I have a button that closes the bowser window

My question:
Once the window is closed, is there a way (via actionscript or any other way for that matter) to change the URL in the original parent window?

Any help is appreciated. Many Thanks!

nITiNkIlLeRmEeRuT
1/30/2004 5:13:00 AM
<HEAD>
<script language="JavaScript">
function redirectParent()
{
var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;

if(ns4) URLStr = "target url";
else if(ns6) URLStr = "target url";
else if(ie4) URLStr = "target url";
else URLStr = "target url";

parent.location = URLStr;
}
</script>
</HEAD>

<BODY onUnload="redirectParent()">
<input type="button" value="Close" onClick="self.close()">
</BODY>

I have no time to test this script.

Nitin

AddThis Social Bookmark Button