# Security Sandbox Violation issue

**URL:** <https://forum.kirupa.com/t/security-sandbox-violation-issue/234450>\
**Category:** flash\
**Created:** [August 2, 2007, 9:46am UTC](https://forum.kirupa.com/t/security-sandbox-violation-issue/234450 "2007-08-02T09:46:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tluczyns](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@tluczyns](https://forum.kirupa.com/u/tluczyns)\
**Post date:** [August 2, 2007, 9:46am UTC](https://forum.kirupa.com/t/security-sandbox-violation-issue/234450/1 "2007-08-02T09:46:40Z")

</div>

[COLOR=black]Here is the fastest method to obtain “… tried to access incompatible context …” violation error:[/COLOR]  
[COLOR=black]we have 2 fla: a.fla and b.fla [/COLOR]

[COLOR=black]in a.fla we put on first frame on Stage:[/COLOR]

```auto

[COLOR=black]var listener = new Object();[/COLOR]
[COLOR=black]this.createEmptyMovieClip("container", this.getNextHighestDepth());[/COLOR]
[COLOR=black]var loader = new MovieClipLoader();[/COLOR]
[COLOR=black]loader.addListener(listener);[/COLOR]
[COLOR=black]loader.loadClip("[/COLOR][[COLOR=black]http://serverPath/b.swf[/COLOR]](http://serverPath/b.swf)[COLOR=black]", this.container);[/COLOR]

```

[COLOR=black]in b.fla we put on first frame on Stage:[/COLOR]

```auto

[COLOR=black]_root.variable = "value"[/COLOR]

```

[COLOR=black]Then we compile (fp8) and send b.swf to the server on serverPath.[/COLOR]  
[COLOR=black]Then we compile (fp8) a.fla and get:[/COLOR]  
[COLOR=black]\*\*\* Security Sandbox Violation \*\*\*[/COLOR]  
[COLOR=black]SecurityDomain ‘[http://serverPath/b.swf](http://serverPath/b.swf)’ tried to access incompatible context ‘file:///C|/localdir/a.swf’[/COLOR]

[COLOR=black]Only one “solution” I found to get rid of it is to put in b.fla this line:[/COLOR]

```auto

[COLOR=black]this._lockroot = true;[/COLOR]

```

[COLOR=black]Hovewer if we want to access \_root of a.swf from b.swf, it is not a solution.[/COLOR]

We can lower fp version of swfs, but it is not a good solution also.

Apart of above I can’t get rid of the error.

[COLOR=black]I tried many combinations of System.security.allowDomain() call.[/COLOR]  
[COLOR=black]In a.fla I put at first line:[/COLOR]

```auto

[COLOR=black]System.security.allowDomain("[/COLOR][[COLOR=black]*[/COLOR]](http://www.kotlin.com.pl/graPizze/test.swf)[COLOR=black]");[/COLOR]
//or 
System.security.[COLOR=black]allowDomain("[/COLOR][[COLOR=black]http://serverPath[/COLOR]](http://serverPath)"[COLOR=black]);[/COLOR]
//or
System.security.allowDomain("[[COLOR=black]http://serverPath/[/COLOR]](http://serverPath/)[COLOR=black]b.swf"[/COLOR]);

```

In b.fla I put at first line:

```auto

[COLOR=black]System.security.allowDomain("[/COLOR][[COLOR=black]*[/COLOR]](http://www.kotlin.com.pl/graPizze/test.swf)[COLOR=black]");[/COLOR]

```

I have tried all possible set of settings of “Local playback security” in Publish Options, I added path to a.swf and b.swf to Settings Manager [http://www.macromedia.com/support/documentation/en/flashplayer/help/settings\_manager04.html](http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html)

Nothing works.  
I also want to notice that in authoring (Test Movie) security issues is at “low level”, so it should not be a problem.

Does any expert have ideas how to get rid of this violation in above situation?
