# Detecting if a MovieClip is already cached?

**URL:** <https://forum.kirupa.com/t/detecting-if-a-movieclip-is-already-cached/216919>\
**Category:** Uncategorized\
**Created:** [February 21, 2007, 6:06pm UTC](https://forum.kirupa.com/t/detecting-if-a-movieclip-is-already-cached/216919 "2007-02-21T18:06:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DiegoMax](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@DiegoMax](https://forum.kirupa.com/u/DiegoMax)\
**Post date:** [February 21, 2007, 6:06pm UTC](https://forum.kirupa.com/t/detecting-if-a-movieclip-is-already-cached/216919/1 "2007-02-21T18:06:27Z")

</div>

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 🙂  
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 ☹

```auto
 
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.
