SOLUTION SecurityError: Error #2060: Security sandbox violation: ExternalInterface caller + CDN + AMAZAON S3 + SWFObject

by troy on January 22, 2010

If you have your assets on Amazon S3 and are using SWFObject you might run into SecurityError: Error #2060:

This is two parts, one you need to get your
allowscriptaccess = "always" since if your serving the html from http://www.yoursite.com and the assets are coming from a different domain e.g. http://yourcdn.amazons3.com you need to allow them to talk to each other.

and if you are using SWFObject with dynamic publishing make sure that flash actually gets that! as it has to go through the magic and mystery of javascript.

So here's the solution, this one baffles me but whatever.

GOOD VERBOSE:
var params = {};
params.allowscriptaccess = "always";
params.menu = false;

BAD INLINE
var params = {allowscriptaccess = "always", menu="false"};

I found this out by using the awesome SWFObject Generator application, then contrasting to what we had coded.

{ 2 comments… read them below or add one }

Agustin Amenabar February 10, 2010 at 12:31 am

Hello Troy:
the BAD LINE doesn’t work because of JS sintax, the “equal” signs should be colons.
like this

var params = {allowscriptaccess:”always”, menu:”false”};

just like in flash, you are creating an object, so you use colons not equal signs.
if it still doesn’t work, it beat me :p

ohhh… I miss flash

troy February 10, 2010 at 12:43 am

Doh you’re right. The worlds of JSON and JSON in actionscript and actionscript in my head aren’t clear enough. LIke I think in real JSON you have to put {“allowscriptaccess”:”always”} too.

Bah humbug.

Leave a Comment

 

Previous post:

Next post: