# Having problems preloading an image

**URL:** <https://forum.kirupa.com/t/having-problems-preloading-an-image/159814>\
**Category:** Uncategorized\
**Created:** [August 20, 2005, 3:02pm UTC](https://forum.kirupa.com/t/having-problems-preloading-an-image/159814 "2005-08-20T15:02:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Unit9](https://avatars.discourse-cdn.com/v4/letter/u/c77e96/32.png) [@Unit9](https://forum.kirupa.com/u/Unit9)\
**Post date:** [August 20, 2005, 3:02pm UTC](https://forum.kirupa.com/t/having-problems-preloading-an-image/159814/1 "2005-08-20T15:02:01Z")

</div>

Hi all, 😃

I’m trying to preload an image into a clip and then have it run an animation with the image after it’s preloaded. [This is the code that I’m using within the clip containing the image (FLA attached)](http://www.geocities.com/gifs10k/image_preload/index.htm):

* * *

frame 1:  
this.loadMovie(“image1.jpg”,1);

## frame3: if ( this.getBytesLoaded == this.getBytesTotal && this.getBytesTotal \> 0 ) { // If the movie has fully loaded then go to and play the image animation in the parent clip, and also goto and stop at the next frame \_parent.gotoAndPlay(2); this.gotoAndStop(4); // If the movie hasn’t fully loaded } else { // Then go back to frame 1 and play from frame 1 to check again this.gotoAndPlay(1); }

Can anyone tell me how I can get this to work?

Note: If the image preloaded correctly, it should fade out once it’s loaded.

Cheers. 😃
