« Working with RFID | Main | Working with Regular Expressions »

Security for Cross-script

By default, Flash Player dose not allow swfA.swf to script swfB.swf because of the diffrent domains. A SWF file gives permittion to SWF files from other domains by calling Security.allowDomain() method. For example shown below, swfA.swf can script swfB.swf, but swfB.swf cannot script swfA.swf. You can set up symmetrical permissions by having both SWFfiles call the Security.allowDomain() method.

swfA.swf

loader.load(new URLRequest("http://siteB.com/swfB.swf"));
loader.content.init();

swfB.swf

Security.allowDomain("siteA.com");
function init(){...};

Post a comment