Today I had (actually I still have) an issue with subdomains, SWF’s and Javascript. For the Floorplanner we communicate with our Flash application via Javascript (using ExternalInterface). On www.floorplanner.com everything works fine, but when I tried to use a subdomain (like whatever.floorplanner.com) an error appeared. First I thought it was a Javascript error, but it turned out to be the Flash Security Sandbox blocking the communication.
To solve this I added the following line to the Flash app:
System.security.allowDomain('http://whatever.floorplanner.com/');
It did the trick, but the thing is that every (paying) user can create and use its own subdomain, so i needed something like this:
System.security.allowDomain('http://*.floorplanner.com/');
That didn’t work. After trying all kinds of different things like crossdomain.xml, I settled with
System.security.allowDomain('*');
This feels like a really nasty hack, but it’s all I can come up with. There has to be a better way…



May 9th, 2007 at 3:12 pm
wouldn’t just System.security.allowDomain(’floorplanner.com’); not work ?
or else System.security.allowDomain(’*.floorplanner.com’);
May 16th, 2007 at 7:50 am
It would seem like that would work per this : http://www.flashguru.co.uk/systemsecurityallowdomain/ I haven’t used it much but I am digging in now and will need this soon. I wonder if it doesn’t like regular expressions? That would be ideal if it did.
May 29th, 2007 at 12:37 pm
@Folkert: both ‘floorplanner.com’ and ‘*.floorplanner.com’ didn’t work… too bad
October 2nd, 2007 at 12:50 pm
Set System.exactSettings to false to allow subdomains
Hope that helps. ..
Justin
June 26th, 2009 at 8:36 pm
have U tried this:
Security.allowDomain(root.loaderInfo.loaderURL);
cheers!