Close Window

Hello,

I’m having an issue with the photo gallery on my web site. Basically what I want it to do is when I click the home button or the about button etc. I want it to close the javascript popup window with my flash movie inside it and navigate to that page on my main websites window.

My code is:


home_btn.addEventListener(MouseEvent.MOUSE_DOWN, homeClick);
home_btn.addEventListener(MouseEvent.MOUSE_DOWN, homeLink);

function homeLink(e:MouseEvent)
{
	var url:String = "home.html";
 	 var request:URLRequest = new URLRequest(url);
  	try 
	{
   		navigateToURL(request, '_blank');
 	}
		catch (e:Error)
	{
    trace("Error occurred!");
  	}
}

function homeClick(e:MouseEvent)
{
  var jscommand:String = "window.close();";
  var req:URLRequest = new URLRequest("javascript:" + jscommand + " void(0);");
  navigateToURL(req, "_blank");
}

Right now it just opens up a new window and doesn’t close the popup window.

Thanks to anyone who helps.