Get current url to Flash swf using an External Interface call
Many have struggled with the task of getting you swf to read or get the current url showing in the browser, the html page the browser is at which has the swf embedded. Not to be confused with the _root._url which returns the path of the swf file. This would be helpful to know if someone is embedding your swfs on their site, or even customize your swf depending on which page it resides on. There is a pretty simple, yet virtually undocumented way to do this. We have to use javascript by calling External Interface and get the url from the DOM. Window.location.href. Then we must call the toString() function only because ExternalInterface.call requires a function rather than only reading a static property.
Visit publisher site: Get current url to Flash swf using an External Interface callListing Details
- Filed in:
-
Scripts / Flash / Tutorials & Tips / Actionscript
- Submitted on:
- Last Updated:
- Dec 25, 2010
- Publisher:
- Evan Mullins Other listings by this publisher
License & Pricing Information
- License Type:
- Freeware
- Price:
- $0.00 USD
- Additional Info:
User Reviews
Be the first to review this listing!Not yet reviewed by any member.... You can be the FIRST one to write a review for Get current url to Flash swf using an External Interface call