Having problems preloading an image

Hi all, :smiley:

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):


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. :smiley: