3 Replies Latest reply on Apr 18, 2008 3:48 PM by kglad

    trouble assigning link to image loaded with loadvars in as 2.0

    SyrtisMajor
      I'm working on a pretty simple image gallery using LoadVars. Images are loaded into a movieclip (framesMC) and I'm trying to assign a link to each loaded image dynamically as well (as the images changes so should the link). So I set up a separate LoadVars (urlLV) to load the URL from a text file and assign it to the movieclip by using getURL once the image has loaded. The text file gets loaded and the image becomes a link but the URL that's linked 1) replaces symbols (periods and slashes) w/ code and 2) also includes the URL of the site where the gallery is. To illustrate an example:

      my text file contains: info=http://www.waterloorecords.com

      the site hosting the swf of the gallery is [url]www.douglasbenjamin.com[/url]

      when I click the link on the site the URL it tries to navigate to is:
      [url]http://www.douglasbenjamin.com/info=http%3A%2F%2Fwww%2Ewaterloorecords%2Ecom[/url]

      here's code for the gallery:

      [code]var curFrameNum:Number = 0;
      var slideInfoLV:LoadVars = new LoadVars();

      slideInfoLV.load("vars/slide_info.txt");

      function loadFrame() {
      var urlLV:LoadVars = new LoadVars();
      var clipLoader = new MovieClipLoader();
      var preloader = new Object();
      var slideURL:String;
      clipLoader.addListener(preloader)

      clipLoader.loadClip("images/web" + curFrameNum + ".jpg", this.framesMC);
      _level0.myLV.load("slidetext/web" + curFrameNum + ".txt", this.loadedInfo);

      // loading the URL...

      urlLV.load("slideurl/web" + curFrameNum + ".txt");
      var slideURL = urlLV;

      preloader.onLoadComplete = function (framesMC){
      framesMC.onPress = function() {
      getURL(slideURL, _blank);
      }
      }
      }

      loadFrame();

      // ----<next slide>---- \\

      this.nextSlideBtn.onRelease = function() {
      if (curFrameNum < Number(slideInfoLV.totalFrames) - 1) {
      curFrameNum ++;
      } else {
      curFrameNum = 0;
      }
      loadFrame();
      }

      // ----<prev slide>---- \\

      this.prevSlideBtn.onRelease = function() {
      if (curFrameNum == 0) {
      curFrameNum = Number(slideInfoLV.totalFrames) - 1;
      } else {
      curFrameNum --;
      }
      loadFrame();
      }[/CODE]

      Is there some attribute I should be referencing for urlLV to make this work? Or am I missing something else? Thanks in advance for any advice.