1 Reply Latest reply on Nov 6, 2006 4:16 AM by Goo101

    Loader component

    Goo101
      Hi There,
      I'm using the following code in Frame2 to load an image to the screen using a loader component . . .

      function loadImages() {
      var iA:Number = AlbumDetails.childNodes.length; //1 childNodes
      var i = 0;
      for (i = 0; i < (iA); i++) {
      var iNumOfTracks:Number = AlbumDetails.childNodes[0].childNodes[0].childNodes.length;
      var a:Number = Number(iNumOfTracks - 6);
      var xmlArtist:XMLNode = AlbumDetails.childNodes[0].childNodes .childNodes[a].childNodes[0].firstChild.nodeValue;
      var Artist = xmlArtist.toString();
      var t:Number = Number(iNumOfTracks - 7);
      var xmlTitle:XMLNode = AlbumDetails.childNodes[0].childNodes
      .childNodes[t].firstChild.nodeValue;
      var Title = xmlTitle.toString();
      var imagePath:String = ("C:\\local audio\\" + clientName + "\\" + Artist + "\\" + Title + "\\folder.jpg");
      if(imagePath.lastIndexOf(":") != 1) {
      var i:Number = Number(imagePath.lastIndexOf(":"));
      var newImagePath = imagePath.substr(0, imagePath.lastIndexOf(":")) + imagePath.substr(imagePath.lastIndexOf(":") + 1);
      }
      else {
      var newImagePath = imagePath;
      }
      imageLoader.contentPath = newImagePath;
      }
      }

      Why when the application goes to Frame3 is the image not being maintained on the screen even though the loader component itself is present in Frame3!?

      Any help would be much appreciated, this is very confusing!
        • 1. Re: Loader component
          Goo101 Level 1
          If I add a stop(); command at the end of Frame 2 the image is definitely maintained in the Loader component, however when I remove the stop(); command and the code moves onto Frame 3 I loose the loaded image.

          How do I maintain the image loaded in Frame 2 through Frame 3?