Techblog

Tech Blog

Our latest geek adventures!

20 November Loading swf’s from different servers

Posted by Gert-Jan on in Flash+ActionScript

Setup

  • SWF A is on server 1
  • SWF B is on server 2
  • SWF’s C…Z are also on server 2

I got multiple Sandbox security errors when I tried to load SWF B (the one from the different server) into SWF A. SWF B loads SWF’s C..Z and I thought that that caused the problem. Only I knew that SWF B already contained the line:

System.security.allowDomain( "*" );

so that couldn’t be it.

When SWF B has loaded it reads a couple of _root variables (normally set by Javascript) to setup its configuration. Because SWF A now loads SWF B instead of Javascript I set the _root vars in SWF A. After a while of debugging this seems to be the problem. SWF B is -by default- not allowed to access _root vars of SWF A. So I added the same line to SWF A et voila!

System.security.allowDomain( "*" );

Leave a Reply