hey,
wonder if anyone can shed light on this for me…
ok, i’ve built a site that loads in images (jpeg) dynamically. a php file looks at my image directory, and makes all the filenames into a list… then in flash i take that list and populate an array with the filenames.
then with my interface the user can navigate to the next / previous image, which then uses the movieClipLoader class to load the jpeg into the movieclip, and i use onLoadProgress to throw in some code to control my preloader graphic.
the problem i’m having, is that flash doesn’t seem to be caching the images once already loaded (as in, if the user goes back to a previously loaded image, the image gets preloaded all over again).
the strange thing is… sometimes it caches images, and sometimes it doesn’t… (although with the latest images i’ve uploaded its not caching any) so i’m ruling out anything wrong with my actionscript (famous last words) and was thinking it was an issue with the server or even the jpegs (maybe different compression settings?!).
can anyone offer an explanation?
cheers,
martin.
its because you are loading it into the same MC
or you haven’t set up a system to check wether it is already loaded, so you just keep reloading
how does that explain it preloading some images and not preloading others though?
ok, after some testing i’ve worked out what the issue is…
it’s the file size of the jpegs. anything under 200k it caches them. anything above, it always preloads even if you’ve loaded them before.
any ideas of how to combat this?
hmm, also seems to be safari specific. firefox seems to cache them ok…
[QUOTE=pixel_streamer;2353693]some recommended tools to prevent browser cacheing…
http://www.kirupa.com/forum/showthread.php?t=217850&highlight=cache+prevent[/QUOTE]
thanks, but if you read the post you’ll see i’m trying to invoke browser caching 
It was late.
You can’t force people to increase the size of their browser cache. If their cache is set to 0MB, or something small, flash should reload the images every time, regardless.
I’m not sure why it would not keep the image in the browser cache, but you can always use the bitmapData api to cache the images in memory. As long as you can keep track of what has been snap-shotted, you’re only limited to the user’s memory.
no worries.
i’ve done some research and it looks to be just a safari specific problem, when images are over 200k.
What happens to the MC you loaded the photo into when you change photos? because you could do it that when a photo loads it is removed from the array and the movie clip’s alpha is set to 0 when on other pictures.
That’s a good idea too, but you may also have to toggle the other image’s visible and/or enabled states too, so that mouse-overs and such would function on the correct layers.
i’m loading in the photos to 2 movieclips… it alternates between the two. basically, an image gets loaded in to the first MC, then the next time i call an image it gets loaded into the second MC so as not to overwrite the MC already loaded on stage… then after the second MC has preloaded the image, i swap the MC’s on stage during a transition, and delete the old one… and so on…
here, to explain easier, this is the site: www.pavely.com
anyway, i’ve seen this problem discussed on another forum here:
that’s just how I would handle it.