Skip navigation
prithvi.zankat
Currently Being Moderated

SWFLoader loded swf and relative path issue

May 7, 2013 5:24 AM

Tags: #swfloader:loader

Hi,

 

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.

 
Replies
  • Currently Being Moderated
    May 7, 2013 9:25 AM   in reply to prithvi.zankat

    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points