Flash webservices and cross domain policy on amazon s3
20/01/09
We have a training website, which is a revised version of a standalone flash application we have built. The challenge is to get all of the swfs, videos, image and resources on Amazons s3 taking the strain off of our clients servers.
So to start with the html/php pages load a .swf from our clients s3 account, for example:
http://s3.amazonaws.com/client/folder/webservices.swf
Next this swf need to load or save data to our webservices on our server at client.example.com. We first have to set up our crossdomain.xml file, which should look like this:
< ?xml version="1.0" encoding="utf-8" ? >
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="master-only" />
<allow-access-from domain="s3.amazonaws.com" />
<allow-http-request-headers-from domain="s3.amazonaws.com" headers="SOAPAction" />
</cross-domain-policy>
The devil is in the url to allow example.com or http://www.example.com may not work but http://www.example.com does!
This policy file then needs to reside on the server you wish to access your webservcies from remotely (client.example.com).
UPDATE:
This works fine, the problem we now have is this; html/php is on our dev server. The swfs and videos are on Amazons s3. Our html page loads the container (lets call it main.swf) when the user selects a sub section, this is a separate swf file that loads into a empty movieclip in main.swf.
The main.swf loads, as do the videos, the subsection swfs load into the empty movieclip… then flash hangs! If I do this localy it works fine. If I load all the swfs on our dev servers it works fine.
I’m a loss right now and don’t have a solution, but will post when I find one.