Skip navigation
erik@postmillennium.com
Currently Being Moderated

Preload Images For Random Slideshow

Jun 8, 2009 6:33 AM

I am using a random slideshow on the homepage of my website. It worded perfect when I was testing it locally, but now that I've uploaded it to an external server which is a bit slower, and there is a delay between loading images. Here's the work in progress site:

www.anyhumanheart.com


I know it has to do with the way the actionscript is written, and the order in which functions are carried out. I just cant seem to get it to function the way I would like it to.

I would like it to immediately load the first image and display it, then while that first image is displayed I would like it to load the second image. Right now it waits until the first image finishes displaying to load the next image.

Trying to get this site up this weekend, any ideas/help would be greatly appreciated.  Thanks.

-Erik

Attachments:
 
Replies
  • Currently Being Moderated
    Jun 8, 2009 7:49 AM   in reply to erik@postmillennium.com

    I can't access the file you uploaded, but here's what you might try...

     

    Keep the loading functionality isolated from the displaying functionality except for the first image... load the first as soon as it's ready, which should kick off the display cycling.

     

    Have a variable that keeps a count of the number of images that have loaded, and another that keeps track of which is being displayed--the intention being that these variables will be compared in order to see if the next to display has been loaded.

     

    Use a fixed timing scheme to control when images are normally switched, but include a check to see if the next image to be displayed is loaded or not, and if it isn't, use a brief time delay to call the function again to keep checking until that next file is indicated as being loaded.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 8, 2009 8:17 AM   in reply to erik@postmillennium.com

    My inability to open the attachment may be a case of you using a Mac to zip the file.  In any case, my suggestion stands.  Do all of your loading separate from the displaying. You will want to use the MovieClipLoader class rather than the loadMovie method so that you can determine when a loading is complete.

     

    For the randomizing, you should just shuffle the library array and read from it in sequence rather than what you do now... unless you don't mind the same image appearing every other one on occasion.

     

    Rather than continually loading for every display event, load the images into containers and control their display thereafter.  This way you are only loading each image once, and not everytime it is deemed to be displayed.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 8, 2009 2:53 AM   in reply to Ned Murphy

    Hello Ned Murphy,

    I have a question. When making random image slideshows, most people are using XML file inserted into Flash and the images are stored outside of the Flash file. I wonder if that make the loading time longer? For example, if I want to make a slideshow in the index page using the images that will be displayed inside gallery, I am storing that same image within the Flash Library and also outside the file for the XML. Doesn't that make the Movie as a whole a little bigger than necessary?

    I don't know may be there is a way to use only one image for both random slideshow and the gallery. Hope my question makes sense.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points