This undocumented method grants permission for the specified domain(s) to access objects and variables in the flash movie that calls the allowDomain method. This property had to be implemented because of the changes made to the Security Sandbox in the Flash 6 Player…
I have two movies, ‘a.swf’ and ‘b.swf’, ‘a.swf’ is located on www.flashguru.co.uk server and ‘b.swf’ is located on www.macromedia.com server, for ‘a.swf’ to be able to access the contents of ‘b.swf’, ‘b.swf’ has to make a call to the allowDomain method as follows:
System.security.allowDomain('http://www.flashguru.co.uk');
The domain can be formatted in numerous ways, the same different formats that the loadVariables, loadVariablesNum, XML.load and LoadVars.load methods accept:
- http://www.domain.com
- http://domain.com
- domain.com
- http://IpAddress
You can pass multiple domains to the method as arguments.
This method has been documented in the Macromedia Flash MX Actionscript Dictionary Errata.