3 Replies Latest reply on Sep 21, 2006 10:13 AM by Rothrock

    Loading external jpegs with loader.contentPath

    Dread_Pirate_Pete
      As requested, I have started a new thread for my issue. I hope you guys can help. Essentially, I have a flash movie that has 1 of 11 possible external jpegs waiting to load into the movie. There is a loader component on the main stage that will house the external jpegs as they are called. This call happens once every 5 seconds on the first frame of a movielcip. At any rate, it works as long as I don't use a web server. The second I use IIS to launch the html file that has the embedded swf file, the movie loads but not the jpegs. The files are all in the same directory, and the final file holding the movie will actually be an asp file. Regardless, testing the movie by just launchign the html file works flawlessly. As soon as I upload the movie to my server, or test usin IIS ( same thing) it loads the movie, but not the jpegs. Please ignore the fact that I am missing a picture and the appropriate if / else statement for the code below.

      Thanks for reading.

        • 1. Re: Loading external jpegs with loader.contentPath
          Rothrock Level 5
          Not really sure how the loader component works, but in general the answer to "It works locally, but not on the web" type of question is that you are not allowing time for the content to load.

          Another issue might be that the jpgs are saved as progressive jpegs. I know that under Flash 7 and earlier you cannot dynamically load a progressive jpeg. But under Flash 8 I think you can. (Can anybody confirm this for me?) So it could be possible that in the testing environment you have Flash 8, but only have Flash 7 plug-in installed for your web browser.

          Other than that a link to said page would be very helpful. :)
          • 2. Re: Loading external jpegs with loader.contentPath
            Dread_Pirate_Pete Level 1
            Okay seriously not, it's working. When I was making a link for you to view, I tested it and noticed the link itself wasn't working. I created a new folder on the server, dumped it all in there, and it's working.

            http://www.rbcontrolsystems.com/testing/logo/test.htm All that is, is just a masked contentLoader. Thanks anyhow, if it wasn't for you asking for the link, as none of it was available to the WAN before, I'd have never solved this.

            The original folder it was in was called "includes" so perhaps that's a reserved server folder with special permissions?

            • 3. Re: Loading external jpegs with loader.contentPath
              Rothrock Level 5
              Cool. Glad that worked out. I have no idea about "includes" but it sounds like something that could be special.

              You could probably make you swf considerably smaller if you didn't use the loader component. I tend not to use any of the premade components because they generally add a big chunk to your published files. Instead you might want to look into using the MovieClipLoader class for future projects.

              Also – not that you asked for it, but you get what you pay for – if you are interested here is how I would conceptualize your project.

              Make an array of all the external graphics you want to load.

              myPics=new Array();
              myPics[0]="donna.jpg"
              myPics[1]="jeff.jpg"
              //and so on.

              You can then avoid having all those if statements by just saying:

              currentContent=myPics[theFlag];

              It would also make it easier if you need to add pictures or have fewer.

              var theFlag = Math.floor(Math.random()*myPics.length);

              Finally, if you wanted to get really fancy, you could shuffle the array and then just step one-by-one. That way all pictures would be loaded without repeats. If you want to go down that path we can help!