Contact Me


Recent Posts


Categories


Archives


Tags

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

Recent Comments

  • Ahmed: Can you put up an example?
  • Ahmed: Hmmm sorry this is a tough one but I don’t work with ASP.NET! Sorry!
  • Michael: Good example but one question… in all the slider skinning I see with Flex the thumb overruns the left...
  • venkata: Hi I am using OAuth to connect to youtube api. I got accessToken and TokenSecret for a particular user. Now...
  • Ahmed: Good old flexlib, what component are you using?

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