# Preloading an array

**URL:** <https://forum.kirupa.com/t/preloading-an-array/190704>\
**Category:** flash\
**Created:** [June 14, 2006, 1:24am UTC](https://forum.kirupa.com/t/preloading-an-array/190704 "2006-06-14T01:24:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pixelcache](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/pixelcache/32/2494_2.png) [@Pixelcache](https://forum.kirupa.com/u/Pixelcache)\
**Post date:** [June 14, 2006, 1:24am UTC](https://forum.kirupa.com/t/preloading-an-array/190704/1 "2006-06-14T01:24:33Z")

</div>

I have done [this](http://www.kirupa.com/developer/mx/preloader_transition.htm) tutorial here at kirupa for transitions. My problem is that I am also using a swf file that has an array that calls in jpegs dynamically. So, how can I modify the preloader script to also include the dynamically loading jpegs as well as preloading normal swf files? Here is the script that is inside the swf that is calling the jpegs.

```auto

var imgList:Array = new Array();
imgList[0] = "images/coral.jpg";
imgList[1] = "images/horizon.jpg";
imgList[2] = "images/resort.jpg";
imgList[3] = "images/sunset.jpg";
imgList[4] = "images/sunset.jpg";
function chooseTheString() {
	randomPic = random(imgList.length-1);
	_root.holder.loadMovie(_root.imgList[randomPic]);
}
chooseTheString();
stop();

```
