# Random images loader

**URL:** <https://forum.kirupa.com/t/random-images-loader/27777>\
**Category:** Uncategorized\
**Created:** [August 6, 2003, 2:45pm UTC](https://forum.kirupa.com/t/random-images-loader/27777 "2003-08-06T14:45:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eberth](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/eberth/32/41_2.png) [@Eberth](https://forum.kirupa.com/u/Eberth)\
**Post date:** [August 6, 2003, 2:45pm UTC](https://forum.kirupa.com/t/random-images-loader/27777/1 "2003-08-06T14:45:51Z")

</div>

ok, so i got it to work, i have this code…  
[AS]  
aMovies = new Array();  
aMovies[0] = “imagenes/imagen1.jpg”;  
aMovies[1] = “imagenes/imagen2.jpg”;  
aMovies[2] = “imagenes/imagen3.jpg”;  
aMovies[3] = “imagenes/imagen4.jpg”;  
aMovies[4] = “imagenes/imagen5.jpg”;  
aMovies[5] = “imagenes/imagen6.jpg”;  
aMovies[6] = “imagenes/imagen7.jpg”;  
aMovies[7] = “imagenes/imagen8.jpg”;  
aMovies[8] = “imagenes/imagen9.jpg”;  
pelicula = aMovies[random(9)];  
contenedor.loadMovie(pelicula);  
[/AS]

How can i automatically create a preloader when each image is loading…???

---

<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:** [August 6, 2003, 3:09pm UTC](https://forum.kirupa.com/t/random-images-loader/27777/2 "2003-08-06T15:09:44Z")

</div>

Hoi

here just put a text boxs on the root timeline called “loadText”

//you random script  
contenedor.createEmptyMovieClip(“holder”, 1).loadMovie(pelicula);  
contenedor.onEnterFrame = function() {  
\_root.loadText.text = Math.round(\_root.getBytesLoaded()/\_root.getBytesTotal()\*100)+"%";  
if (this.holder.getBytesLoaded()\>=this.holder.getBytesTotal() && this.holder.getBytesTotal()\>10) {  
//your script that runs after the image is loaded  
delete this.onEnterFrame;  
}  
};

😉

---

<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:** [August 6, 2003, 6:15pm UTC](https://forum.kirupa.com/t/random-images-loader/27777/3 "2003-08-06T18:15:01Z")

</div>

and if i want a small preloading bar???

---

<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:** [August 6, 2003, 6:37pm UTC](https://forum.kirupa.com/t/random-images-loader/27777/4 "2003-08-06T18:37:58Z")

</div>

ohh, i tested it, and it doesnt work… ☹

---

<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:** [August 6, 2003, 7:42pm UTC](https://forum.kirupa.com/t/random-images-loader/27777/5 "2003-08-06T19:42:17Z")

</div>

ok i will see if i can make an example 😉

---

<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:** [August 6, 2003, 8:34pm UTC](https://forum.kirupa.com/t/random-images-loader/27777/6 "2003-08-06T20:34:53Z")

</div>

please 😃

---

<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:** [August 7, 2003, 8:55am UTC](https://forum.kirupa.com/t/random-images-loader/27777/7 "2003-08-07T08:55:07Z")

</div>

Here…

😉

---

<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:** [August 7, 2003, 1:45pm UTC](https://forum.kirupa.com/t/random-images-loader/27777/8 "2003-08-07T13:45:20Z")

</div>

thankyou 🙂
