简体   繁体   中英

Loading Flash / Flex Applications in another AIR Application

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.

You may need to explicitly indicate in Flash code that you will allow it to be loaded into another VM. Check out the flash.system.Security class documentation for details: http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/system/Security.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM