Skip to main content
Participant
October 26, 2017
Question

Why "*** Security Sandbox Violation ***" message is generated debugging with FlashBuidler ?

  • October 26, 2017
  • 0 replies
  • 562 views

My question is about the following message that is generated when debugging with FlashBuidler 4.6.

### console output message ###

*** Security Sandbox Violation ***

SecurityDomain 'http: // localhost: 8400 / hoge / remoteWeb.swf' tried to access incompatible context 'app: /mainAir.swf'

##############################

I am creating air application (mainAir.swf) that loads swf (remoteWeb.swf) from web server and registers it as child component.

(Internally, flash.display.Loader.load() and addChild()).

 

When I launch the application with debugger, The Security Sandbox Violation message are repeatedly generated.

Furthermore, when I click the part corresponding to swf(remoteWeb.swf) on the Air application window, The above message is generated.

Although the above message is generated, my air application seems to be working properly from the following perspectives.

- loaded swf(remoteWeb.swf) are displayed.

- An mouse click eventhandler that I set in loaded swf works.

- When I launch appliction without debugger, It seems to be working normally.

### Question ###

Why the above security error message is generated?

Does this message really mean my air application have any security problems? Im not sure this is real issue or just information.

### Soucre Code ###

------------------------------------------------------------------------------------------

mainAir.mxml (mainAir.swf) # Created as a flex air project

------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>

<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"

xmlns:s="library://ns.adobe.com/flex/spark"

xmlns:mx="library://ns.adobe.com/flex/mx"

creationComplete="onCompleteLoad()"

                       >

<fx:Script>

<![CDATA[

            import flash.net.URLRequest;

            import flash.system.LoaderContext;

            import mx.core.UIComponent;

                  

            private function onCompleteLoad():void {

                trace("Call onCompleteLoad()");  

                var loader:Loader = new Loader();

                var loader_context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);

                loader.load(new URLRequest("http://localhost:8400/hoge/remoteWeb.swf"), loader_context);

                uicomponent.addChild(loader);

            }

          

]]>

</fx:Script>  

<mx:UIComponent id="uicomponent" width="100%" height="100%" >

</mx:UIComponent>

</s:WindowedApplication>

------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------

remoteWeb.mxml  (remoteWeb.swf) # Created as a flex web project

------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

xmlns:s="library://ns.adobe.com/flex/spark"

xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"

               click="onClick()"

               >

<fx:Script>

<![CDATA[      

            private function onClick():void {

                trace("Call onClick() !!!");  

            }

]]>

</fx:Script>

<s:Label text="this is remoteWeb.mxml "/> </s:Application>

------------------------------------------------------------------------------------------

This topic has been closed for replies.