28 June allowDomain() troubles … again
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.



