I am using BitmapData.draw() on a DisplayObject that includes an image from my AWS S3 bucket. The image loads fine in the swf when I set the S3 image URL as the source for an Image object but when I use BitmapData.draw() on it, it gives me this error:
SecurityError: Error #2122: Security sandbox violation: BitmapData.draw: https://www.example.com/Example.swf cannot access https://s3.amazonaws.com/example-images/example.jpg. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.
AS code:
var bmpd:BitmapData = new BitmapData(objectToDraw.width,objectToDraw.height);
bmpd.draw(objectToDraw);
I have tried putting the following crossdomain.xml file in my S3 bucket root to no avail:
<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*"/>
</cross-domain-policy>