views:

35

answers:

1

I have inherited a website which is build entirely in Flash and the main swf is 4.5MB large (ouch!). As you might guess this has caused a large hosting bill for my client. To solve the issue somewhat I want to move this monolithic swf to Amazon S3, however, this is causing security issues.

This is how the larget swf is currently being loaded; A loader.swf on mydomain.com is loading the large swf from s3.amazonaws.com. This works, however, the large swf is in turn loading assets from mydomain.com. I was hoping that since the loader.swf (on my domain) is loading the large swf, that the large swf would live in the context of the loader.swf.

I have tried putting a Security.allowDomain in both swf's pointing to each others domains but this doesn't seem to solve the issue. The error that I'm currently trying to solve is:

-- Remote SWFs may not access local files.
SecurityError: Error #2148: SWF file https://s3.amazonaws.com/static.mydomain.com/verylarge.swf cannot access local resource 

Any help tackling this problem would be greatly appreciated.

A: 

You may need a crossdomain policy file on S3 , allowing access from your domain

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM
  "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"&gt;

<cross-domain-policy>
  <site-control permitted-cross-domain-policies="master-only"/>
  <allow-access-from domain="yourdomain.com"/>
  <allow-access-from domain="s3.amazonaws.com/static.mydomain.com"/>
</cross-domain-policy>
PatrickS
I thought that initially, too, except that it's complaining about accessing a "local" resource. Hopefully the OP will try this and we'll see if that works.
Michael Todd
It's a bit confusing though since the OP says that the assets are loaded from his domain and doesn't mention any other local assets.
PatrickS
@PatrickS. What do you mean by "other local assets"? The website consists of a number of externals which are all loaded by the very large swf. I'd like those assets to remain on my domain except for the large swf. What is it exactly you want me to elaborate on?
Luke
@Luke i meant any other assets than the large swf located on s3 as opposed to externally on your domain. the security error states it cannot load locally, whilst you mention loading assets remotely from your domain, this is what i thought was confusing
PatrickS