We have a flex application that loads other flash files (SWF) (loading swfs with the flex application). The location of the "content" directory is not the same as the application directory (flex/bin). The URLs in the content have all been coded as relatve URLs like assets/data,xml. Is there an easy way to fix the URLs to point to a directory outside of flex/bin? For example, in this case it would be expected the assets directory under flex/bin and the data.xml file to be located there.
One thing we looked into is extending the loader class and creating our own loader class, and this worked provided the method call was using a loader.load call. But the content also calls URLLoader and netstream.play and any number of other calls load calls a yet undiscovered. It seems that any relative call to play or load a piece of content always looks at flex bin as opposed to the content directory.
Keep in mind the content files are developed outside of the application, we merely"play" them in our application calling loader.load on SWF files as needed.
We are trying to minimize the impact of going through and updating all the exsting content files that have been developed. The most labor intensive solution is code in the full relative path in the URL which we are trying to avoid.
Shouldn't the path of the parent SWF be used and not the Flex application, or does Flex consider the parent always to be the flex applicaiton regardless of what SWF the flex application is trying to load?
Those URLs are relative to the location of the SWF, i.e. to the HTML page containing the SWF.
Yes, that is the problem. I want the relative URLs to be relative to the SWF that is loading, not the parent
Well… isn't it the same thing? If you go to http://www.timos.com/timos/green/ct/CounterThink.cfm and press on "About CounterThink", you will see a bunch of links to other pages of the site. Those are all relative to CounterThink.cfm, which contains the SWF – and whatever your loader loads.
Or maybe I missed something in your question?