简体   繁体   中英

Flex SWFLoader - Relative Root Path of Embedded SWF vs Parent App

I am trying to load a SWF file that is generated externally (Pano2VR) into my main Flex app. I use the SWFLoader MXML object and everything works fine locally. I really want to put the child SWF into another domain though (cloud). That works fine too (once I setup the crossdomain.xml file), but there is a rub.

The child SWF application itself requests additional images - problem is that the file paths requested are relative. Looking at a network call trace (in browser), I see that the child SWF file now thinks it's base URL path is the base URL path of my parent SWF.

For example: my (parent) Flex app is hosted at www.xyz.com, and my "child" SWF file is hosted at www.123.com. Technically, the "child" SWF file needs to look for its resources based on a base path of www.123.com - however I see it is querying my parent app's base path, www.xyz.com. I cannot control the "child" SWF, only the containing one I am writing.

Is there any way I can override the base url path of the loaded SWF file (in SWFLoader) from within my app?

Thanks for any help! Fred.

You must decide what application domain your child module will be loaded into. Take a look at this documentation

By default, the application domain loads into the parent one, thus getting the behavior you are seeing.

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