views:

25

answers:

2

I need my swf to be able to see the domain of the page that it's loaded on. Normally to to this I would just look at window.location over ExternalInterface, but in this particular case the swf is going to be embedded with allowscriptaccess="never", so that's not going to work. Is there an actual api that will give me that or do I have to resort to ugly hacks?

A: 

Have you tried this :

var pageURL:String = stage.loaderInfo.url;
cmann
That returns the url of the swf, not the url of the page that the swf was loaded on.
rabidsnail
Would you be able pass the URL of the page to the swf through the FlashVars parameters? The downside of this would be that you would have manually add this to the pages where the file is embedded.
cmann
That can be trivially forged.
rabidsnail
A: 
loaderInfo.loaderURL
www0z0k
Does that work when the swf is being embedded and not loaded by another swf? The docs would suggest no.
rabidsnail