A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Preload JPG's never ending story

  1. #1
    Junior Member
    Join Date
    Aug 2001
    Posts
    29

    Preload JPG's never ending story

    I know this have been asked more times than we have days in a year but i've searched and read just about everything written about it and still haven't found it.

    What i want to to is to load and preload a bunch of jpg's into empty clips which i later want to fade in and out with simple tween's on the timeline. I would also like to load the files from a xml or txt file so i can change it rather than edit the fla again if i wants to remove/change pictures.
    Macomedia has a simple and nice JPEG slide show with XML which is allmost what i want.. it doesn't have any preloader for it and it seems to load each picture everytime you push the buttons.
    I would rather have one preloader for all pictures and have all of them loaded into their movie clips.
    I thought that i would make a slideshow with a max of 20 pictures, and in some way if there's only 8 pictures the slide should behave like the 8th picture is the last.

    I've made a little slide test which demonstrate how i want it to behave/look like.
    Slide test zip 280kb
    Preview slide test here

    I'm not tallented enough to figgure all of this out so i'm asking all of the nice and tallented people here for help
    Any help would be highly appreciated.

    Thanks a bunch

    Jim
    Last edited by jmx; 08-18-2003 at 09:32 PM.

  2. #2
    Junior Member
    Join Date
    Aug 2001
    Posts
    29
    Anyone.. thoughts.. ideas?

  3. #3
    shorter than most, but not all findShorty's Avatar
    Join Date
    Apr 2002
    Location
    brisbane
    Posts
    239
    you need to create only enough image holders, or thumbnail holders, for the number of images you are loading - so load the image urls first from a php or asp page, using movieClip.loadVariables("phpscript.php");, maybe in a comma delimited string thus:

    &imgURLs=img1.jpg,img2.jpg,...,imgN.jpg

    then:
    Code:
    movieClip.onData = function () {
         imgArray = imgURLs.split(","); // gives you an array
         generateThumbnails(imgArray);
    };
    function generateThumbnails(imgArray) {
         var imgCount = imgArray.length;
         for (i=0; i<imgCount; i++) {
              // add your movieclip generation script here
              imgMC._visible = 0;
              imgMC.loadMovie(imgArray[i]);
         }
    }
    hope this gives you some ideas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center