1 Reply Latest reply on May 7, 2013 9:25 AM by Flex harUI

    SWFLoader loded swf and relative path issue




      Before explaining the problem, let me describe the usecase.


      I have dashboard flex application hosted on Host1.

      I have another flex application which acts as plugin to dashboard and is hosted on Host2.

      I am using proxy to load plugin into dashboard using SWFLoader. With proxy SWFLoader in dashboard thinks that the plugin is coming from same host.


      For plugin to load I specify SWFLoader source something like - source="Proxy/Host2WebappDir/plugin.swf.


      Everything is fine upto this point. plugin.swf get loads successfully without any issue.


      Now the problem -

      If plugin.swf made some request - the url path of that requrest is expected to be relative - i.e. if it make request say getIndianStates.xml, I am expecting the request should look for resource at "Proxy/Host2WebappDir/getIndianStates.xml". Instead it tries to look for getIndianStates.xml into dashboard hosting directory on Host1.


      Can this issue be resolved without making any modification in source of plugin.swf.


      Thanks in advance,

      Prithveesingh Zankat.

        • 1. Re: SWFLoader loded swf and relative path issue
          Flex harUI Adobe Employee

          I don’t know if any way to fix this without changing the URL the plugin wants to load.  Now if the plugin stores that URL in a publicly accessible variable, you might be able to access it from the main SWF and change it.  But it would be better to have the plugin detect relative paths and make sure they are relative to the SWF.  The SWFLoader component uses a LoaderUtil class to do that for SWFs it loads, but loads that don’t use SWFLoader need similar fix ups.