Get URL of the Page Where SWF is Embedded: Appendix

/ Published in: ActionScript 3
Save to your folder(s)

<p>Alternatively, to access the URL where the SWF resides we can access the url property of the LoaderInfo object belonging to our SWF's root. Note this is the location of the SWF file and NOT the HTML page it's embedded in. It's important to make this distinction as both the SWF and HTML could reside on different domains.</p>

Copy this code and paste it in your HTML
  1. root.loaderInfo.url;


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.