Detecting if a MovieClip is already cached?

Hi there, im an avid reader of this site and forums, but im new to the forums, so first of all, hi everybody, and thanks kirupa for this great site!

I guess my question is pretty simple for some of the guru’s here, but i gave up with this already :slight_smile:
Im writing an photo gallery application for a website, everything works just perfect, but i have the following problem:
Im using the events onLoadComplete and onLoadStart to display an small popup alerting the user while the picture is downloading… so how could i check if the picture is already cached ?, so i could use an IF statment to only show the popup if the picture has not been downloaded before ?

This is the relevant part of the code that im using right now, it works perfect, but it shows the “loading clip” EVEN if the picture is already there :frowning:

 
listener2.onLoadStart = function(target:MovieClip):Void  {
 var myTween:Tween = new Tween(loading_graph, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 80, 1, true);
 var myTween2:Tween = new Tween(loading, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 80, 1, true);
 loading.gotoAndPlay(1);
 //trace(loading._currentframe);
 infobar.next_btn.enabled = false;
 infobar.previous_btn.enabled = false;
};
listener2.onLoadComplete = function(target:MovieClip, httpStatus:Number):Void  {
 if (aClips[p] != null) {
  var myTween:Tween = new Tween(loading_graph, "_alpha", mx.transitions.easing.Strong.easeOut, 80, 0, 1, true);
  var myTween:Tween = new Tween(loading, "_alpha", mx.transitions.easing.Strong.easeOut, 80, 0, 1, true);
  loading.gotoAndPlay(11);
  //infobar.next_btn.enabled = true;
  //infobar.previous_btn.enabled = true;
  slideshow();
 }
};

Any suggestion would be appreciated.
Thanks in advance.