This time it’s a little different then the last time (with the subdomains). In the Floorplanner all the furniture elements are seperate swf’s which are loaded one by one. To minimize our data traffic we wanted to move all the furniture swf’s to Amazon’s S3 service and load them from there.
To get all the swf’s to S3 we used the Amazon S3 Firefox Organizer which is a very nice Firefox extension. Then we changed all the url’s in the (development) database and everything seemed to work fine.
BUT….. (there always is a but) one tiny little thing didn’t work, you couldn’t change the color of the furniture. Every furniture element has a color movieclip, but the Floorplanner couldn’t reach it anymore. Because the swf’s are loaded from another server, the SandBox security of Flash just didn’t allow it.
To make a (very) long story short… we had to add one line of code to every swf:
System.security.allowDomain( '*' );
We tried all different kind of things:
System.security.allowDomain( '*.floorplanner.com' );
System.security.allowDomain( 'floorplanner.com' );
System.security.allowDomain( 'www.floorplanner.com' );
this one did work, but then the subdomains didn’t…..
System.security.allowDomain( 'http://floorplanner.com' );
System.security.allowDomain( 'ip-address' );
System.security.allowDomain( 'http://ip-address' );
and the only one that really worked was ‘*’ …. aarrrgggghhh.



July 29th, 2007 at 5:25 pm
This is so frustrating!
The sandbox security is even crazier when dealing with local SWFs, I was trying to load an external swf from a remote domain into a local swf and the ‘localTrusted’ sandbox simply wont allow cross scripting between them.
The current sandbox security is far too rigid..
August 8th, 2007 at 2:28 pm
I don’t know your code, if it is AS3 and how it is organized, but I think that a way you could try could be “shared events”. I read about it in “Essential Actionscript 3.0″ by Moock, he talks about them as an alternative to allowDomain(). Obviously enough it makes sense if you use events in your code.