# Preloader on Dynamic Jpg Loader

**URL:** <https://forum.kirupa.com/t/preloader-on-dynamic-jpg-loader/15570>\
**Category:** flash\
**Created:** [March 15, 2003, 9:47pm UTC](https://forum.kirupa.com/t/preloader-on-dynamic-jpg-loader/15570 "2003-03-15T21:47:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mastawok](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@mastawok](https://forum.kirupa.com/u/mastawok)\
**Post date:** [March 15, 2003, 9:47pm UTC](https://forum.kirupa.com/t/preloader-on-dynamic-jpg-loader/15570/1 "2003-03-15T21:47:05Z")

</div>

Ok so I am using the following code from the dynamic jpg loader tutorial:

photo1.onRollOver = function () {  
\_root.createEmptyMovieClip(“container”, 1);  
loadMovie(“photos/BuriedFence.jpg”, “container”);  
container.\_x = 200 ;  
container.\_y = 134.5;  
}

But what I want is for it to load the image but while it is loading to show a percent loaded preloader for the image specifically.

How do I do it? PLEASE HELP!

Michael

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 15, 2003, 9:48pm UTC](https://forum.kirupa.com/t/preloader-on-dynamic-jpg-loader/15570/2 "2003-03-15T21:48:31Z")

</div>

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=15472](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=15472)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 15, 2003, 10:54pm UTC](https://forum.kirupa.com/t/preloader-on-dynamic-jpg-loader/15570/3 "2003-03-15T22:54:32Z")

</div>

this.createEmptyMovieClip(“preloader”,\_1000);

this.createEmptyMovieClip(“container”,\_1001);

//container.\_x = 250 ;

//container.\_y = 0 ;

container._visible_=\_false;

preloader.onEnterFrame\_=_function()_{

\_\_\__var\_l_=\_container.getBytesLoaded();

\_\_\__var\_t_=\_container.getBytesTotal();

\_\_\__var\_getPercent_=\_l/t;

\_\_\_\_//loadText = Math.round(getPercent\*100)+"%";

\_\_\_\_loadBar._width_=\_getPercent\*500;

\_\__if(l\>0_&&_l\>=t)_{

\_\_\_\_\_\_\_\_container._visible_=\_1;

\_\_\_\_\_\_\_\_delete\_this.onEnterFrame;

\_\_\_\_}

};

button.onPress\_=_function()_{

\_\_\_\_container.loadMovie(“test.jpg”);

};

I have your code in one hand hehe and my site in the other. I’m confused  
Using the following variables can you please show me what the code would look like? Do I need to make a preloader instance?? What is “preloader” calling?

Ok so

the image name is:

photos/BuriedFence.jpg

and the button instance name is:

photo1

and I want it to be on rollover instead of click.

PLEASE!
