Is another site/URL using my Flash SWF?

There is not a clear way in Flash access what site is using your SWF. On DTS's media page, we allow users to embed our media player in their blogs (like all other video sites these days), but it is difficult to know the URL of the file who is pulling the file. stage.loaderInfo.url is just the URL of the SWF, but not the HTML page which embeds the SWF. The only way I found to do this is to call ExternalInterface and ask JavaScript what the URL of the page is. So here's what I came up with:

var urlReferrer:String = ExternalInterface.call("document.location.href.toString");

The reason for the "toString() is that ExternalInterface.call wants you to use a function rather than just calling a static property.

Update (01/08/08): Looks like someone else has caught on to this.

3 thoughts on “Is another site/URL using my Flash SWF?

Comments are closed.