/ Published in: ActionScript 3
Here's how I was able to capture the HREF of a page using actionscript
Expand |
Embed | Plain Text
//Here's a list of helpful items to capture var pageURL:String = ExternalInterface.call('window.location.href.toString'); var pageHost:String = ExternalInterface.call('window.location.hostname.toString'); var pagePath:String = ExternalInterface.call('window.location.pathname.toString'); var pageProtocol:String = ExternalInterface.call('window.location.protocol.toString'); var userAgent:String = ExternalInterface.call('window.navigator.userAgent.toString'); var platform:String = ExternalInterface.call('window.navigator.platform.toString'); private function getQueryString():String { var query:String = ExternalInterface.call("window.location.pathname.toString"); //ExternalInterface.call("window.location.href.toString"); return query; }
Comments
Subscribe to comments
You need to login to post a comment.

This is possible only when allowScriptAccess is set to"always" in tag but in most of the website like myspace they set allowScriptAccess to samedomain and in this case we are not allowed to use ExternalInterface.
Do we have any alternate way to get the browser URL - not the location of swf.
Please suggest.
Thank You, Lasavi