1 Reply Latest reply on Jan 22, 2007 9:46 PM by Newsgroup_User

    Relative Path Problem

    Dj_Mario
      Simple problem, i have a file named gallery.swf in /site/gallery/ and when i launch the file swf from that directory the loading is going fine, im loading a xml file with this command "xmlReadGalleries.load("photo_galleries.xml")" so the file is loading from /site/gallery/photo_gallery.xml, no problem there. But, when i run the master.swf from /site/ and then load the gallery.swf into it, it would not work becuse then it tries to load the file from /site/photo_gallery.xml and not /site/gallery/photo_gallery.xml. So here's my question. Why don't it load from the root directory of the gallery.swf file? And is there anyway to fix it?
      //Mario
        • 1. Re: Relative Path Problem
          Level 7


          Dj Mario wrote:
          > Simple problem, i have a file named gallery.swf in /site/gallery/ and when i
          > launch the file swf from that directorty the loading is going fine, im loading
          > a xml file with this command "xmlReadGalleries.load("photo_galleries.xml")" so
          > the file is loading from /site/gallery/photo_gallery.xml, no problem there.
          > But, when i run the master.swf from /site/ and then load the gallery.swf into
          > it, it would not work becuse then it tries to load the file from
          > /site/photo_gallery.xml and not /site/gallery/photo_gallery.xml. So here's my
          > question. Why don't it load from the root directory of the gallery.swf file?
          > And is there anyway to fix it?
          > //Mario

          SWF does not know or remembers its place on server / directory.
          Once html loads it, it seek its files from perspective of that HTML file.
          So if you keep them all in one folder and place it deep into sub/sub1/sub2
          than load it from html in SUB, it will thing it is its original position
          and not sub2. Causing paths mismatch. Normally we do design the projects
          with that in mind from scratch.
          In your case the path would be : gallery/photo_gallery.xml


          --
          Best Regards

          Urami


          --

          !!!!!!! Merry Christmas !!!!!!!
          &
          Happy New Year


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