# Adding a Preloader to a Photogallery?

**URL:** <https://forum.kirupa.com/t/adding-a-preloader-to-a-photogallery/12777>\
**Category:** flash\
**Created:** [February 4, 2003, 5:18pm UTC](https://forum.kirupa.com/t/adding-a-preloader-to-a-photogallery/12777 "2003-02-04T17:18:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![7of9](https://avatars.discourse-cdn.com/v4/letter/7/c89c15/32.png) [@7of9](https://forum.kirupa.com/u/7of9)\
**Post date:** [February 4, 2003, 5:18pm UTC](https://forum.kirupa.com/t/adding-a-preloader-to-a-photogallery/12777/1 "2003-02-04T17:18:56Z")

</div>

First of all this is a great forum and I’m a newpie here. I’m also new to Flash Mx and  
trying to learn it through books and examples.

Question, Adding a preloader component to a photogallery.

In a recent thread:  
[http://www.kirupaforum.com/showthread.php?threadid=11567](http://www.kirupaforum.com/showthread.php?threadid=11567)  
someone listed a resize question regarding images. The question was answered and part of the  
code is as follows:

//reference to loadMe movieclip  
lm\_mc = \_root.loadMe;

\_global.loadImage = function(img) {  
//dump old container  
img\_mc.removeMovieClip();  
//create container for images inside loadMe movieclip  
img\_mc = lm\_mc.createEmptyMovieClip(“imageContainer”, 1);  
//load image movieclip  
img\_mc.loadMovie(img);  
//check to see if image has loaded  
lm\_mc.onEnterFrame = function() {  
if(img\_mc.\_width \> 0) {  
resizeImage();  
delete this.onEnterFrame;  
}  
}  
}

Therefore, I would like to add a preloader while loading the images by using  
the following preloader component.

Note: the Preloader has a target path property.

[http://www.kirupa.com/developer/mx/preloader\_component.asp](http://www.kirupa.com/developer/mx/preloader_component.asp)

To the best of my availablity, I have to add the preloader component  
property to if(img\_mc.\_width \> 0) and also drag the component to a specific  
frame, but where?

Thanks, note I’m a newpie to flash Mx, patience and details will be very  
much appreciated.
