This may sound like a strange request, but I need to be able to determine:
-
What browser domain the current swf is executing in (that is, the page that hosts the swf is displayed in a browser, what is the domain of the page)?
-
What server domain the SWF was loaded from (ie, what the URL domain was for the SWF)?
I believe both of these I can get via javascript and ugly workarounds and pass them in, but what I need is actually to get these values (at least #2) from inside the SWF without relying on the javascript in the hosting page.
Specifically, what I’m trying to determine is if the SWF is executing in a page from the same domain as it itself was hosted/loaded from. I want to fork on this test and create different behavior for a SWF if it’s “hot-linked” (that is, loaded onto a page on a different domain from where I host it).
I’ve looked into flash.system.SecurityDomain and ApplicationDomain… both these have properties called ‘currentDomain’ which would seem to be the value i’m looking for (for #2), however this object is a static variable that I can’t seem to get any information out of or transform into any kind of useful string that I can look at it’s value and test with it.
The only info I’ve found on either of those two classes all relates to passing them to LoaderContext and such, when you are loading external resources.
I do not want to load anything, I just want to determine how and where the SWF is executing.
please help!?