problem in retreiving browser url
Hello,
I want to reterive the browser url where my swf is embedded in actionscript 3. I have written the following code which is working in Firefox and Safari but it doesn't work on IE and chrome. Please anyone help me out.
getURL.swf
public function getURL()
{
var pageURL:String = ExternalInterface.call('window.location.href.toString');
ExternalInterface.call('showAlert', pageURL);
}
HTML
html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>getURL1</title>
<script language="javascript">
function showAlert(url)
{
alert(url);
}
</script>
</head>
<body>
<embed src="getURL.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="getURL1" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</body>
</html>