AS3 detect page title and URL ExternalInterface.call

This is very handy script if you are trying to see where exactly the SWF has been loaded from you can read the Title of the page and the URL by using “ExternalInterface.call” method.

var title:String = ExternalInterface.call('window.document.title.toString');
var <a href="url:String">url:String</a> = ExternalInterface.call('window.location.href.toString');

res.appendText( "url = "+url+" \ntitle = "+title ); //add a text field to the stage called "res"

Example (note that this is sitting in a iframe @ http://sputn1k.co.uk/labs/url/)

Adobe Labs
AS2
AS3

Vote in HexoSearch

Tags: ,

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

  • Categories

  • Recent Comments

  • Recent Posts

  • Tumblr

  • Flickr Recent Photos

    cherry tree woodstonja_gravestonesPockey Chimp FlavourAUTO FTW! :)darkdaystayouttiger kittenbirdofpreyfirst photo i took with my 1000dself_portrait_02
  • XFIRE (wkly hrs pld)

  • Last.FM

  • Tags

    .MP4 Actionscript Action Script Advertising AS2 AS3 backtrack BT4 bug Call of Duty capcom centOS COD count down countdown crossdomain Eyeblaster eyeblaster HD f4v Flash h264 HD high definition Install internet explorer Linux loadMovie MIME MIME Types MW2 Nazi Zombies pc PHP ports preloader release date rich media shared objects SWF SWFOBJECT timer torrents Video video/mp4 win7