title: Securtity Domain... tried to access incompatible context
body: <p>I have been trying for over a day now to get my flex application to load the flash file from an external source, but I keep getting the following error. </p>
  
  <p>I have a crossdomain file with wildcard mapping and I use the Security.allowDomain('*'). What the heck is going on???</p>
  
  <pre><code>*** Security Sandbox Violation ***
  SecurityDomain 'http://somedomain/en/interface.swf?sessionid=38D1E0B7-5356-42FC-B692-4E1EA019FD9A&amp;gametype=64&amp;affiliateid=1&amp;currency=CHP&amp;language=eng&amp;freePlay=0' tried to access incompatible context 'file:///C:/_Projects/Casino_Old/FlashWrapperWorkspace/CasinoV2Loader/bin-debug/CasinoLoader.html'
  </code></pre>
  
  <p>I'm using the following code</p>
  
  <p>
  </p>
  
  <pre><code>&lt;fx:Declarations&gt;
      &lt;!-- Place non-visual elements (e.g., services, value objects) here --&gt;
  &lt;/fx:Declarations&gt;
  
  &lt;fx:Script&gt;
      &lt;![CDATA[
          import flash.display.Loader;
          import flash.display.Sprite;
          import flash.events.Event;
  
          import mx.controls.Alert;
          import mx.controls.SWFLoader;
  
          import spark.modules.ModuleLoader;
  
          protected function initApp():void
          {
              var url:String = "http://somedomain/servlet/com.goblinstudios.lollipop.servlet.CasinoGatewayProxy3?sessionid=38D1E0B7-5356-42FC-B692-4E1EA019FD9A&amp;gametype=64&amp;affiliateid=1&amp;currency=CHP&amp;language=eng&amp;freePlay=0";
              Security.allowInsecureDomain("*");
              Security.allowDomain('*');
  
              var sprite:Sprite = new Sprite();
              var loader:Loader = new Loader();
              sprite.addChild(loader);
  
              var lc:LoaderContext = new LoaderContext(true);
              lc.checkPolicyFile = true;
              loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
              loader.load(new URLRequest(url), lc);   
          }
  
  
          private function onComplete(e:Event):void {
              addElement(e.target.loader.content);
          }
      ]]&gt;
  &lt;/fx:Script&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>Crossdomain.xml
  
  
  &lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"&gt;
  &lt;cross-domain-policy&gt;
      &lt;allow-access-from domain="*" /&gt;
      &lt;allow-http-request-headers-from domain="*" headers="SOAPAction"/&gt;
  &lt;/cross-domain-policy&gt;
  </code></pre>