Skip to Content »

FlashApe » Security Restrictions in the Authoring environment

 Security Restrictions in the Authoring environment

  • September 14th, 2004
  • 1:40 pm

Why?

While working on a project today, I was loading in some data via flash remoting from a remote server. thats fine, everythign works smoothly. Try to load in a jpg from the remote server, I get:

bq. *** Security Sandbox Violation ***
SecurityDomain ‘http://www.myserver.com/images/1.jpg’ tried to access incompatible context ‘file:///C|/wamp/www/website/myfile.swf’

Yeah baby!! Flash security restrictions in the authoring environment. God, I feel so secure.

The solution? Set allowDomain of the security object to the domain you want to load the swf/jpg from:

bc[as]. System.security.allowDomain(”http://www.myserver.com”);

Its a small little step, I know, but it’s one little step I’d like to not deal with while im developing, that I am just going to have to take time out and remove later.

123 CCTV Security Camera Surveillance Equipment - Security Systems Complete security camera systems and packages for the home or business.

19 People had this to say...

Gravatar
  • Gil Colgate
  • April 1st, 2006
  • 5:20 pm

I have an issue duplicating a loaded movie clip. DuplicateMovieClip emits the following error:

*** Security Sandbox Violation ***
SecurityDomain ‘http://testserver/assets/DeadTrees.swf’ tried to access incompatible context ‘file:////testserver/Inetpub/wwwroot/art/walkingdemo.swf’

note I use this: System.security.allowDomain(”http://testserver”);

The movie ends up not being duplicated.
Anyone have an idea?

Gravatar

hi

thx for the security tip. i had exactly the same problem.

patrick heusser

Gravatar
  • jo
  • June 22nd, 2006
  • 3:28 pm

cheers,
I had the same thing.

Gravatar
  • PalMediC
  • July 3rd, 2006
  • 11:08 pm

Me too, thanks

Gravatar
  • lix
  • July 21st, 2006
  • 6:42 am

Thanks, thanks, thanks! You rule :bow: :)

Gravatar
  • Sergio Martinez
  • October 10th, 2006
  • 7:25 am

It doesn’t work for me… I hate you all flash

Gravatar
  • cip
  • January 20th, 2007
  • 9:18 am

you’re right, thanks

Gravatar
  • egeshi
  • March 11th, 2007
  • 10:11 pm

This problem most often happens when you are launching .swf file at, say, http://www.yoursite.com and loading SWF from http://yoursite.com/ (without WWW) and vice versa.
Just check paths attentively and use one path convention for all paths in your code. I am unsure whether everything else helps 100% with *** Security sandbox violation *** and incompatible context.

Gravatar
  • Egg
  • April 8th, 2007
  • 6:17 am

This has been bothering me for days. Thanks a lot!

Gravatar
  • Ruth
  • May 8th, 2007
  • 7:59 am

Thanks You So Much!!! :-)

Gravatar

thanks
you saved my day :)

Gravatar
  • Vishwa
  • August 31st, 2007
  • 12:22 am

Thank you soo much rich !

Gravatar
  • Adz
  • September 6th, 2007
  • 6:02 pm

Even better, save some duplication and use this!

System.security.allowDomain(’*');

Gravatar

I was having the same problem trying to run an app in the flash environment loading and downloading JPGs off the server I am working on, and used the fix listed above, but upon some mouse events that I was using to enable drag/drop functionality, the same security sandbox error would still happen - very annoying.

The fix I found was to use ANOTHER container movie clip inside the original to load the remote image, and then applying all property changes, mouse events, or other interactive manipulations of the object to the outermost container movie clip, and not the inner one holding the image. For whatever reason, I guess this separates the cross-domain loaded object from the events, even though the outcome is the same.

In this manner, I didn’t even need the System.security.allowDomain(’*'); fix, although that did clear up a number of the errors initially.

So, try creating an innerHolder type workaround if you can’t seem to get rid of those annoying Sandbox errors..

Gravatar
  • Amir
  • December 10th, 2007
  • 1:10 am

thanks alot, it solved my problem! :D

Gravatar
  • adyphp
  • January 27th, 2008
  • 2:49 pm

@Sean Powell

yep that solved my **SandBox** problem too ..

You are a genius :)

…im back in “Hello actionScript World” :D

Gravatar

[…] Security Sandbox Violation AFAIK, it’s to do with cross domains - see fix HTH __________________ CSS Trickery | CSS Tutorials, Tips and Tricks for all […]

Gravatar

Hah, thanks for the post.

I have been doing ActionScript 3 for quite some time now, and was getting really really angry that Security.allowDomain(”*”) was not working in this ActionScript 2 project I am working on.

Your nice post kicked me right back into ActionScript 2 mode.

Gravatar
  • Kristina
  • March 28th, 2008
  • 8:57 am

I couldn’t get it to work I still get the stupid security message:

Do I need to change anything in this? I just copied and pasted the exact code??

bc[as]. System.security.allowDomain(”http://www.myserver.com”);

Want your say?

* Required fields. Your e-mail address will not be published on this site


You can use the following XHTML tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>