4 Replies Latest reply on Mar 17, 2010 12:22 PM by sovtek01

    Air  *** Security Sandbox Violation ***

    flex Creek

      <?xml version="1.0" encoding="utf-8"?>
      <mx:WindowedApplication creationComplete="init()" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="588" height="522">
            <mx:Script>
              <![CDATA[
                  private function init():void
                  {
                          //Security.allowDomain("*");
                  }
              ]]>
          </mx:Script>
          <mx:HDividedBox width="100%" height="100%">
                  <mx:Button id="test"></mx:Button>
                  <mx:Image source="http://www.epopos.com/os.jpg"/>
          </mx:HDividedBox>
      </mx:WindowedApplication>
      Above is a simple code of the air.It's mainly load a picture from network.The picture can be displayed normally.
      But when we drag the HDividedBox will produce Security Sandbox Violation.
      like this 
      *** Security Sandbox Violation *** 
      SecurityDomain 'http://www.epopos.com/os.jpg' tried to access incompatible context 'app: / Test.swf' 
      *** Security Sandbox Violation *** 
      SecurityDomain 'http://www.epopos.com/os.jpg' tried to access incompatible context 'app: / Test.swf' 
      Flex Application for the same code. We can use 'Security.allowDomain ("*");' to solve this problem. 
      However, We cann't use Security.allowDomain ("*") in Air.It will produce SecurityError.
      Analysis:   
             The reason of produced the problem is than  when we drag the HDividedBox led to 'os.jpg' access air.But air doesn't allow it.
      Test solution:       

           Adodb's SandboxBridge is aim to solve that air and a remote swf internal communication problems, but it still substantial differences between them,

      so this option will do not work.   
            This issue has nothing to do with crossdomain.xml, Air doesn't access crossdomain.xml,Air can access any resources from network in default. 
            Air access resources from network is normal, and if this problem is not solved,when we drag HDivideBox will lead to beef-witted or even stuck
      DataGird is the same problem, I do not know whether it'is the flex bug,
      I have searched a large number of articles,but it is not be resolved,

            I hope someone can help me .Thank you very much.