1 Reply Latest reply on Apr 30, 2008 8:01 PM by Newsgroup_User

    Local Run SWF Embedded in Webpage does not find relative paths to XML & CSS

    mad_valentine
      Hi,

      I have a website that will be run on a computer (not on a web server, and it may be moved around onto other machines).

      There is a webpage in the root folder, which has a flash file embedded in it using the default dreamweaver cs3 embed script.
      The flash SWF file is located in a folder called Media.
      The flash swf access two files that are also in the Media folder: a css style sheet and an xml content file.


      When running the SWF locally, it locates the XML and CSS perfectly.
      When embedding it in the webpage, it becomes apparent that the path that it is using to find these files is now relative to the webpage itself and no longer to the SWF.

      I do not really want to have to define the paths differently in teh SWF file (some files will be used in different places and will need to be demo'ed as they stand).

      Notably, i do not get the same issue once the file is uploaded to a test webserver, however this material will not be on a web server ultimately.

      Is there a way of forcing either Flash or DW to use the paths in the SWF relative to the SWF rather than relative to teh webpage - a line of actionscript for example that will force the paths to be seen as relative from the swf.

      I have looked at this page http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_04157 and also at various other methods of embedded Flash into a page (e.g the swfobject method) but have had no luck with those and wanted to know if any one had found a solution in a more direct manner. (I have not invested a lot of time into those solutions as did not know if they are what I need or not - If either will fix the issue, do let me know and I shall persevere with it!).

      Many thanks

      Liz
        • 1. Re: Local Run SWF Embedded in Webpage does not find relative   paths   to XML & CSS
          Level 7
          mad_valentine wrote:
          > Hi,
          >
          > I have a website that will be run on a computer (not on a web server, and it
          > may be moved around onto other machines).
          >
          > There is a webpage in the root folder, which has a flash file embedded in it
          > using the default dreamweaver cs3 embed script.
          > The flash SWF file is located in a folder called Media.
          > The flash swf access two files that are also in the Media folder: a css style
          > sheet and an xml content file.
          >
          >
          > When running the SWF locally, it locates the XML and CSS perfectly.
          > When embedding it in the webpage, it becomes apparent that the path that it is
          > using to find these files is now relative to the webpage itself and no longer
          > to the SWF.

          are you sure the path is to your files is Media/file.css and Media/file.xml ?
          Keep in mind that once you run from within HTML that calls file from some folder,
          the paths change.

          > I do not really want to have to define the paths differently in teh SWF file
          > (some files will be used in different places and will need to be demo'ed as
          > they stand).

          you have no choice, the paths must be consistent and can't be flexible.

          > Is there a way of forcing either Flash or DW to use the paths in the SWF
          > relative to the SWF rather than relative to teh webpage - a line of
          > actionscript for example that will force the paths to be seen as relative from
          > the swf.

          the SWF always assumes location of its host HTML document. No matter how deep in
          a folders and sub folders you going to place it, if the HTML is in the root of the
          folder, this is where the SWF will look from for its files to load. Always from the
          perspective of the host html file, not its original location. The paths then must be
          adjusted accordingly.



          >


          --
          Best Regards

          Urami


          --
          "Never play Leap-Frog with a Unicorn."


          <urami>
          If you want to mail me - DO NOT LAUGH AT MY ADDRESS
          </urami>