all groups > flash actionscript > february 2007 >
You're in the

flash actionscript

group:

Flash Chaching for Images


Flash Chaching for Images McArger
2/28/2007 9:47:40 PM
flash actionscript:
I am trying to preload images that are used throughout a flash slideshow. I
have a preloader that takes an array of filenames (imageArray) and uses that to
load an image into a movie clip. Each movie clip has an image, all movie clip
images are held within one other movieclip.
So...
holder_mc.mc0 has an imageArray[0]
holder_mc.mc1 has an imageArray[1]
holder_mc.mc2 has an imageArray[2]
...and so on.

They load fine into these movie clips, but now I need to know how I can use
these movie clips in another movie clip in the animation part.

Right now I am just loading the image into the movie clip, hoping that the
image is cached somewhere in flash and it automatically pulls it from there
instead of download it again. Is that how it works or not?
What I'm diong now:
main_mc.loadMovie(imageArray[0]);
then later:
main_mc.loadMovie(imageArray[1]);
etc...
Is this just redownloading the image? Or is it getting it from a cache? If
it isn't getting it from cache, how can I use the stored images in the
holder_mc clip to load into the main_mc clip when I need them?
Re: Flash Chaching for Images McArger
2/28/2007 10:35:51 PM
So is it even neccessary to download each image into a separate movie clip?
Can I just download one after another into the same movie clip thereby erasing
the previous one? After that all calls to that image will still go to the
cache in flash? Or do the images need to be held in a flash object?
Re: Flash Chaching for Images kglad
2/28/2007 10:41:10 PM
no, it's not necessary (nor particularly efficient).

yes, you can download them sequentially into the same target movieclip.

yes, after intially retrieving the image from a server the image is thereafter
retrieved from the user's cache (unless you do something to prevent that).

and no, the images don't need to exist within flash for retrievals after the
first to be made from the cache.
Re: Flash Chaching for Images SymTsb
2/28/2007 10:42:36 PM
Yes. So long as the path doesn't change, these images will be cached to the
browsers cache just as if you were visiting a regular html page that has images
on it.

I'm not sure if the same applies for after leaving the site (images are in
IE/FF/Whatever's cache). It is quite possible that the Flash Player will kill
any reference to the image after you leave the site and close your browser.
Re: Flash Chaching for Images McArger
2/28/2007 11:30:19 PM
AddThis Social Bookmark Button