# Array: too many items!

**URL:** https://forum.kirupa.com/t/array-too-many-items/149307
**Category:** flash
**Created:** [May 27, 2005, 6:53pm UTC](https://forum.kirupa.com/t/array-too-many-items/149307 "2005-05-27T18:53:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![imported\_East\_High](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/imported_east_high/32/1331_2.png) [@imported\_East\_High](https://forum.kirupa.com/u/imported_East_High)
#### Post date: [May 27, 2005, 6:53pm UTC](https://forum.kirupa.com/t/array-too-many-items/149307/1 "2005-05-27T18:53:31Z")

</div>

Hey again,  
I’m still working on this little side show that uses an array to loop though the pics. I’m now realizing that there’s going to be a whoooole lot of pictures in this array and instead of list them all individually I’m hoping there’s some way to define the array as every image in a directory. I could possibly have it loop by telling flash to start over once it looped through the total amount. Anyway here’s my code (minus the long array) if it helps.:-/

```auto
stop;
stage.showMenu = 0;
stage.scaleMode = "noScale";
this.pathToPics = "pics/";
pics = new Array("01.jpg", "02.jpg", "03.jpg");
var count = 0;
_root.createEmptyMovieClip("container_mc", 2);
preloadMovie(this.pathToPics+pics[count]);
//functions////////////////
function preloadMovie(clip) {
	container_mc.loadMovie(clip);
	var temp = this.createEmptyMovieClip("temp", 9999);
	temp.onEnterFrame = function() {
		//preloader_mc._visible = true;
		var loaded = container_mc.getBytesLoaded();
		var total = container_mc.getBytesTotal();
		//var getPercent = Math.round((loaded/total)*100);
		//preloader_mc.loadBar_mc._xscale = getPercent;
		//load_txt.text = "Processing "+getPercent+" %";
		if (loaded == total && total>10) {
			//loadBar_mc._xscale = 0;
			//preloader_mc._visible = false;
			//load_txt.text = "";
			container_mc.onPress = function() {
				nextPic();
				sound_mc.play();
			};
			delete this.onEnterFrame;
		}
	};
}
function nextPic() {
	count++;
	if (count>20) {
		count = 0;
	}
	preloadMovie(this.pathToPics+pics[count]);
	trace(count);
}

```
