3 Replies Latest reply on Mar 2, 2010 2:23 PM by cheftimo

    Relative URLs in a Flex Application

    jraynorESP Level 1

      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?