0 Replies Latest reply on Jul 13, 2006 10:48 PM by dragon14

    Referencing a folder

    dragon14
      Hi

      I have a problem where i have a directory structure detailed below

      BannerFolder
      imagesFolder
      banner.swf

      TopicFolder
      intro.html
      siteMap.html

      ok the banner.swf file is located in the banner folder but it is embeded in both the intro.html and siteMap.html which are at different levels of the folder structure.

      The banner.swf file internally references the images folder to load them into the banner.swf file which then display in each of the html files in the two different locations. See Code Below

      function loadImage(){
      banners = 13.; //number of jpg
      directory = "Banner/images/"; //the folder that jpgs are kept from sitemap level
      //directory = "../Banner/images/"; //the folder that jpgs are kept from topic level

      As you can see i have to have two different directory paths to get back to the images folder because the banner.swf file actually tries to load the images folder from the html page it is currently embeded in instead of directly from the fodler it is located in.

      The Question
      Is there a way of making the directory path read from the location of the banner.swf file location and not the location of the html it is embeded in?
      ie
      directory = "images/";

      Taking into account that the banner.swf file is located one level up from the images folder

      BannerFolder
      imagesFolder
      banner.swf

      The Banner is embeded into the html files in the following manner

      this function is located in an external .js file
      function InsertBanner()
      {
      document.write('<object width="700" height="100">\n');
      document.write('<param name="movie" value="Banner/banner.swf" />\n');
      document.write('<embed src="Banner/banner.swf" quality="high" type="application/x-shockwave-flash" width="700" height="100">\n');
      document.write('</embed>\n');
      document.write('</object>\n');
      }

      It is called and embeded in the html document with the following code

      <script type="text/javascript" src="../../../../Javascript/banner.js"></script>
      <script language="javascript" type="text/javascript" >InsertBanner();</script>


      Thanks in advance