3 Replies Latest reply on May 22, 2006 1:27 PM by

    contentPath not working in a loop for a Loader component

      i'm trying to load pics into a loader in my movieclip, i'm looping through about 20 items, to be placed in a movieclips dynamically attached...

      this does not work...
      mcContainer['node'+nCount].pic.contentPath=myimagepath;

      this does work...
      mcContainer['node'+nCount].pic.loadMovie(myimagepath);
      but it does not come in scaled / sized like I want...

      any reason why the images do not appear in the loader component in the movieclip? it's like the screen is not being refreshed or the loader never finishes, when I trace the contentPath after the fact it says the right path, but no image is there.
        • 1. Re: contentPath not working in a loop for a Loader component
          tonyhigham Level 1
          contentPah is used to specify linkageID's only, and will not work for a URL. you correctly used the load method to get the picture in there, now you just have to scale it. if you set the loader's scaleContent to true, your image will scale to the loader's size, and vice versa if you set the property to false. if you need to do some custom scaling based on the size of the image, you can grab those properties like so:

          myLoader.content._width

          not that the above property, and any scaling commands, will only work after the loader finishes loading, so you'll need to put that stuff in an event handler for the loader.complete event...

          hope that helps
          • 2. Re: contentPath not working in a loop for a Loader component
            thanks for the tips.

            although i did get it to work, by simply putting....

            this.contentPath=images\myimage.jpg

            ...in the script for the Loader instance on the stage, basically just give it a dummy image to load. now all my images load up fine dynamically. go figure.
            • 3. Re: contentPath not working in a loop for a Loader component
              matter of fact doesnt matter what you put in that script, just as long as it is one character long....on the instance on the stage.

              i put ...a;....on line one, and it works.