# Getting sandbox violation even with crossdomain.xml

**URL:** <https://forum.kirupa.com/t/getting-sandbox-violation-even-with-crossdomain-xml/307885>\
**Category:** Uncategorized\
**Created:** [April 12, 2010, 9:29pm UTC](https://forum.kirupa.com/t/getting-sandbox-violation-even-with-crossdomain-xml/307885 "2010-04-12T21:29:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lackmaster](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lackmaster](https://forum.kirupa.com/u/lackmaster)\
**Post date:** [April 12, 2010, 9:29pm UTC](https://forum.kirupa.com/t/getting-sandbox-violation-even-with-crossdomain-xml/307885/1 "2010-04-12T21:29:48Z")

</div>

CS4:  
I must not grasp the concept, please help:

## [domain1.com](http://domain1.com) hosts a small swf. The swf contains a loader that loads a swf from [domain2.com/dir/dir/](http://domain2.com/dir/dir/). All works fine when the loader swf is hosted in [domain2.com](http://domain2.com), however, when accessed from [domain1.com](http://domain1.com) I get this in IE:

## SecurityError: Error #2070: Security sandbox violation: caller [http://domain2.com/dir/dir/black.swf](http://domain2.com/dir/dir/black.swf) cannot access Stage owned by [http://domain1.com/dir/loader.swf](http://domain1.com/dir/loader.swf).

black.swf from domain2 references a variable from the loader swf and plays FLVs.

I have tried the crossdomain.xml file at the root of [domain2.com](http://domain2.com) in every way that it could be created. Including the “\*” method.

1. Does it belong at the root of [domain2.com](http://domain2.com) (the remote swf being loaded)? Or at the root of the [domain1.com](http://domain1.com) (the small swf with the loader)? (I’ve actually tried both, neither work)

2. Do I need something in my actionscript somewhere? Right now I don’t have anything related to crossdomain in my actionscript. Everything I’ve read just makes it seam that all you need is the crossdomain.xml file at the root of your webserver.

## AS3 from my loader in [domain1.com](http://domain1.com):

var remotePath:String = “[http://domain2.com/dir/folder/assets/flash/](http://domain2.com/dir/folder/assets/flash/)”;  
var swf:MovieClip;  
var loader:Loader = new Loader();

var defaultSWF:URLRequest = new URLRequest(“[http://domain2.com/dir/dir/black.swf](http://domain2.com/dir/dir/black.swf)”);

## loader.load(defaultSWF); loader.x = 0; loader.y = 0; addChild(loader);

## Some relevant AS3 from domain2.swf:

## trace(MovieClip(parent.parent).remotePath); loader.load(new URLRequest(MovieClip(parent.parent).remotePath+“cms/xml/config.xml”)); stream2.play(MovieClip(parent.parent).remotePath+“open.flv”);

Thanks for your help, I appreciate it.

Lackmaster
