Contact Me


Recent Posts


Categories


Archives


Tags

3d actionscript Actionscript 2 Actionscript 3 api APIs as2 as3 brand carousel channel code compress contest contract CSS Flash flv fp10 free gadget gadgets gdata google JavaScript jquery mvc papervision papervision3d PHP player playlist proxy puremvc pv3d Python search tube tutorial twitter video widget XML you youtube

Links


Help end world hunger

Security Sandbox Violation Getting You Down?

When working with Flash Player you will come across this error one time or another:

*** Security Sandbox Violation ***
SecurityDomain ‘http://s.ytimg.com/yt/swf/cps-vfl104716.swf’ tried to access incompatible context ‘http://www.youtube.com/v/fXldKmGuPqM &autoplay=0&loop=0&rel=0&showsearch=0&hd=1′

And it may not necessarily be for YouTube (as the above error is).

Now don’t fret because there are ways around this. Flash Player allows you to specifiy “safe” domains from which it shouldn’t complain about security violations. By the way, you can read up about Flash Player security settings here.

So how do we fix it? Well we use the “Security()” class. The following code basically tells Flash Player that we’re allowing SWFs from these locations to access stuff in our SWF:

1
Security.allowDomain( 'www.mydomain.com' );

And this will (hopefully) stop your warnings appearing.

However, most of the time, the warnings stem from Actionscript 2, and then you’ll need to put the allow domain code in your Actionscript 2 SWF, using code similar to:

1
System.security.allowDomain( 'www.mydomain.com' );

3 Responses to “Security Sandbox Violation Getting You Down?”

Leave a Reply

Your comment:

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Fork me on GitHub