Loading Flash / Flex Applications in another AIR Application

Posted by t.stamm on Stack Overflow See other posts from Stack Overflow or by t.stamm
Published on 2010-05-11T07:52:20Z Indexed on 2010/05/11 7:54 UTC
Read the original article Hit count: 267

Filed under:
|
|
|

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 below 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.

© Stack Overflow or respective owner

Related posts about flash

Related posts about flex