Do you know how to close a child window for flash? If child window is closed, click the url link again then new window will open and stay focus. But can't close the child window.
1) I try a simple test use this code and it won't work:
var jscommand:String = "window.close('http://www.esri.com');";
var req:URLRequest = new URLRequest("javascript:" + jscommand + " void(0);");
navigateToURL(req, "self");
and test the javascript code here able to do the task I want but how to use it in flash?
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test Page</title>
<script type="Text/javascript">
var theChild;
function OpenWindow()
{
if(theChild!=null)
{
if(!theChild.closed)
{
theChild.close();
}
}
url='http://www.esri.com';
theChild = window.open(url, 'theChild', 'menubar=no,location=no,resizable=no,toolbar=no,scrollbars=auto');
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" id="btnOpen" onclick="OpenWindow()" value="open" />
</div>
</form>
</body>
</html>
1) I try a simple test use this code and it won't work:
var jscommand:String = "window.close('http://www.esri.com');";
var req:URLRequest = new URLRequest("javascript:" + jscommand + " void(0);");
navigateToURL(req, "self");
and test the javascript code here able to do the task I want but how to use it in flash?
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test Page</title>
<script type="Text/javascript">
var theChild;
function OpenWindow()
{
if(theChild!=null)
{
if(!theChild.closed)
{
theChild.close();
}
}
url='http://www.esri.com';
theChild = window.open(url, 'theChild', 'menubar=no,location=no,resizable=no,toolbar=no,scrollbars=auto');
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" id="btnOpen" onclick="OpenWindow()" value="open" />
</div>
</form>
</body>
</html>