# Check if image has already been loaded

**URL:** <https://forum.kirupa.com/t/check-if-image-has-already-been-loaded/264607>\
**Category:** flash\
**Created:** [June 27, 2008, 6:25pm UTC](https://forum.kirupa.com/t/check-if-image-has-already-been-loaded/264607 "2008-06-27T18:25:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tpspoons](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@tpspoons](https://forum.kirupa.com/u/tpspoons)\
**Post date:** [June 27, 2008, 6:25pm UTC](https://forum.kirupa.com/t/check-if-image-has-already-been-loaded/264607/1 "2008-06-27T18:25:55Z")

</div>

Well as the title sais, is there anyway to check if the image has been cached, or has already been loaded so you can skip the preloading process (it looks pretty ugly when the preloader appears and disappears in an instant).

Thanks.

---

<div class="post-metadata">

**Author:** ![skineh](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@skineh](https://forum.kirupa.com/u/skineh)\
**Post date:** [June 27, 2008, 6:56pm UTC](https://forum.kirupa.com/t/check-if-image-has-already-been-loaded/264607/2 "2008-06-27T18:56:18Z")

</div>

If you hang on to the loader you used the first time around for the image, you check its content property. If the image hasn’t been loaded already, it’ll trace null. Otherwise it’ll trace [object Bitmap]

---

<div class="post-metadata">

**Author:** ![tpspoons](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@tpspoons](https://forum.kirupa.com/u/tpspoons)\
**Post date:** [June 27, 2008, 7:32pm UTC](https://forum.kirupa.com/t/check-if-image-has-already-been-loaded/264607/3 "2008-06-27T19:32:54Z")

</div>

Yea thats the proble, I’m using a new loader every time.

---

<div class="post-metadata">

**Author:** ![Felixz](https://avatars.discourse-cdn.com/v4/letter/f/ecb155/32.png) [@Felixz](https://forum.kirupa.com/u/Felixz)\
**Post date:** [June 27, 2008, 8:08pm UTC](https://forum.kirupa.com/t/check-if-image-has-already-been-loaded/264607/4 "2008-06-27T20:08:47Z")

</div>

It is impossible flash doesn’t know about file loading because Browser does it. U should thing about some kind of fading or waiting 1-2 secs to show preloader

---

<div class="post-metadata">

**Author:** ![tpspoons](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@tpspoons](https://forum.kirupa.com/u/tpspoons)\
**Post date:** [June 27, 2008, 8:10pm UTC](https://forum.kirupa.com/t/check-if-image-has-already-been-loaded/264607/5 "2008-06-27T20:10:02Z")

</div>

☹ Yea I was thinking about setting a timer, guess thats what I’ll do.

Thanks for the reply

---

<div class="post-metadata">

**Author:** ![tpspoons](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@tpspoons](https://forum.kirupa.com/u/tpspoons)\
**Post date:** [June 27, 2008, 8:31pm UTC](https://forum.kirupa.com/t/check-if-image-has-already-been-loaded/264607/6 "2008-06-27T20:31:46Z")

</div>

Hmm that seems like a lot of effor and for something so small 😛 Thanks for the response thos, I’ll keep that in mind.

---

<div class="post-metadata">

**Author:** ![tpspoons](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@tpspoons](https://forum.kirupa.com/u/tpspoons)\
**Post date:** [June 27, 2008, 9:06pm UTC](https://forum.kirupa.com/t/check-if-image-has-already-been-loaded/264607/7 "2008-06-27T21:06:47Z")

</div>

Thanks alot 😃 I’ll look into that.
