[flashpro] image caching

Micah Freedman i at micahfreedman.com
Wed Aug 17 09:14:01 EDT 2005


Thanks for your response, but I need a bit more detail and some  
clarification.

On Aug 17, 2005, at 4:24 AM, Timo Stamm wrote:

> Micah Freedman wrote:
>
>> In a related question to my previous post, can anyone tell me  
>> about  how caching of loaded images works?
>
> If an image with the requested name is found in the cache, return it.
> If no image with the requested name is found in the cache, load it,  
> save it in the cache, return it.

Yes, that's pretty much the definition of a cache. I guess what I was  
asking is does the flash player have an image cache? (I presume yes.)  
Can it share it with the browser? (I presume no.) Does it (the  
player) remember the cache between sessions? (Seems unlikely.) Does  
it remember the cache between frames? (Seems likely.) Can I check the  
cache manually for an image? (No idea.)

>> If I want to use the same loaded  image in multiple places within  
>> a movie,
>
> This is not possible.

What!? Of course it is. I can load the same image (from a URL, e.g.  
"flowers.jpg") into multiple movie clips at different locations on  
the stage. The question is, does the flash player treat them as  
separate downloads (which would be annoyingly inefficient), or does  
it recognize that "flowers.jpg" is already being loaded by both  
movieClips, and just download it to the client once?


>> what's the best way to  handle the downloading/preloading issues?
>
> What are these issues?

Hmm... well, I'm building an image viewer app, and I'm looking for  
advice/discussion of best practices in terms of when and how to load  
the images for maximum efficiency from the user's point of view.

>> duplicateMovieClip?
>
> Does not work with loaded movieclips.

too bad.

>> Does it  just "know" that it's already downloaded that image when  
>> you ask for  it again if the url is the same?
>
> What do you mean with "it"?

By "it", I mean the player, or the movieClip which reuses the image.  
(This is similar to my question above about using the same image in  
multiple places.) If the images were in my movie's library, I could  
reference them as many times as I wanted and after the first time,  
they'd just be cached and wouldn't have to download. I'm not sure  
that this is true with the images which I'm loading from the filesystem.

Thanks again,

Micah





More information about the FlashPro mailing list