0
votes

I am trying to retrieve the pageDomain that my swf file is hosted in, as explained here:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/Security.html#pageDomain

This works fine on player compiled in 10.3(flash player version) and above, however the case I am using it is so:

A parent swf compiled in 10.2 loads a swc compiled with 11.4(has the Security.pageDomain), in that case I get undefined as a result to Security.pageDomain query.

Any suggestions on how this can be resolved?

Thanks!

1
why not compile everything to 10.3 or 10.4? - The_asMan
I would like to reach an audience that might have older versions of FP. - Eran
The only time you need to worry about versions is when the user has IE6. There is nothing wrong with a prompt that tells the user to update their player. - The_asMan

1 Answers

0
votes

As the reference indicates, pageDomain is supported by Flash 10.3 and up. So you can't use it, unless you run your code compiled for 10.3 or later. (As far as the parent / child stuff... loading a child into your scope is effectively the same as eval()ing it. So different versions => could get unexpected behavior).

The only other option is probably to use ExternalInterface to check the value of window.location.host. Having said this, this is probably not secure, as malicious javascript has an opportunity to tamper with the code that converts the result from javascript to flash - meaning they could spoof any host they want. So this is probably a Bad Idea.