On Wed, May 21, 2008 at 10:56 PM, Robert Csiki <[EMAIL PROTECTED]> wrote:
> Thanks for your reply. The browser does cache my images, but still server
> calls are made (by the Image object) whenever the object refresh is required
> (i.e. when Flex repaints the component). That's what I want to control, and
> the question was is Image able to do that or I have to write my own class?

Either the Flash Player is using the browser's cache or it isn't. If
you're seeing server calls (either through a sniffer like Charles or
in your server logs), then it isn't.

I think you should write your own component that grabs the actual
Loader object from your own in-memory cache.

 // Setter method in your custom component.
 public function set url(value:String):void
 {
   _url = value;

   var image:Loader = cache[_url];
   if (!image) {
     image = new Loader();
     image.load(_url);

     cache[_url] = image;
   }

   addChild(image);

   ...
 }

And so on.

Update: Ah! It seems that SuperImage already does something like that.
Check that out.

Reply via email to