0 Replies Latest reply on May 11, 2010 12:56 AM by timo-s

    Loading Flash / Flex apps in Adobe AIR

    timo-s

      Hi there,

       

      i'm loading a Flex Application in my AIR App and i'm using the `childSandboxBridge` and `parentSandboxBridge` to communicate between those two. Works like a charm.

       

      But i've tried to load a Flash Application (the main Class extends `Sprite`, not `Application`) and therefore i get a SecurityError when trying to set the `childSandboxBridge` on the loaderInfo object.

       

      In the Flex app it's like this:

      (I'm casting the loaderInfo since the `childSandboxBridge` Property is only available in AIR.)

       

          loaderInfo = FlexGlobals.topLevelApplication.systemManager.loaderInfo;

          try {

             Object(loaderInfo).childSandboxBridge = this;

          } catch(e:Error) {

           ...

          }

       

      In my Flash app it's like this:


          loaderInfo = myMainObject.loaderInfo; // myMainObject is the same class as 'root'

          try {

             Object(loaderInfo).childSandboxBridge = this;

          } catch(e:Error) {

           ...

          }

       

      In the bottom example i get the following SecurityError:

       

         Error #3206: Caller app:/airapp.swf/[[DYNAMIC]]/1 cannot set LoaderInfo property childSandboxBridge.

       

      The SecuritySandbox for both examples is 'application'.

       

      Any ideas why it doesn't work with the Flash app?

      Thanks in advance.