# Array problem

**URL:** <https://forum.kirupa.com/t/array-problem/29898>\
**Category:** Uncategorized\
**Created:** [September 1, 2003, 6:36pm UTC](https://forum.kirupa.com/t/array-problem/29898 "2003-09-01T18:36:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![blueshift](https://avatars.discourse-cdn.com/v4/letter/b/ac91a4/32.png) [@blueshift](https://forum.kirupa.com/u/blueshift)\
**Post date:** [September 1, 2003, 6:36pm UTC](https://forum.kirupa.com/t/array-problem/29898/1 "2003-09-01T18:36:53Z")

</div>

Hopefully this should be the last hurdle I have to overcome for my site to be finished. You guys have been really helpful so far, I’m hoping someone can figure this one out, too. I have arrays of photos that I’m dynamically loading, the first one for each section loads just fine; “live” “candid” and “publicity” in my movie, but the “next picture” button does nothing. I used the same exact method for moving through an mp3 array and it works just fine. Any ideas?

[Heres the file with sample pics](http://web.ics.purdue.edu/~rstremke//array.zip)

---

<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:** [September 1, 2003, 6:39pm UTC](https://forum.kirupa.com/t/array-problem/29898/2 "2003-09-01T18:39:21Z")

</div>

Are those non pregressive jpg’s?

---

<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:** [September 1, 2003, 7:07pm UTC](https://forum.kirupa.com/t/array-problem/29898/3 "2003-09-01T19:07:01Z")

</div>

They are saved as Baseline (“Standard”) in Photoshop.

---

<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:** [September 1, 2003, 7:11pm UTC](https://forum.kirupa.com/t/array-problem/29898/4 "2003-09-01T19:11:00Z")

</div>

What is the entire code you used ?

---

<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:** [September 1, 2003, 7:28pm UTC](https://forum.kirupa.com/t/array-problem/29898/5 "2003-09-01T19:28:34Z")

</div>

[AS]  
var pic\_array = [“photos/live/1.jpg”, “photos/live/2.jpg”, “photos/live/3.jpg”, “photos/live/4.jpg”, “photos/live/5.jpg”, “photos/live/6.jpg”, “photos/live/7.jpg”, “photos/live/8.jpg”, “photos/live/9.jpg”, “photos/live/10.jpg”, “photos/live/11.jpg”], currentPic = 0;  
var pic\_array2 = [“photos/candid/1.jpg”, “photos/candid/2.jpg”, “photos/candid/3.jpg”, “photos/candid/4.jpg”, “photos/candid/5.jpg”, “photos/candid/6.jpg”, “photos/candid/7.jpg”, “photos/candid/8.jpg”, “photos/candid/9.jpg”, “photos/candid/10.jpg”, “photos/candid/11.jpg”], currentPic2 = 0;  
var pic\_array3 = [“photos/publicity/1.jpg”, “photos/publicity/2.jpg”, “photos/publicity/3.jpg”, “photos/publicity/4.jpg”, “photos/publicity/5.jpg”, “photos/publicity/6.jpg”, “photos/publicity/7.jpg”, “photos/publicity/8.jpg”, “photos/publicity/9.jpg”, “photos/publicity/10.jpg”, “photos/publicity/11.jpg”], currentPic3 = 0;

function loadFile(picTitle){

```
this.createEmptyMovieClip("holder", 1);
holder._x = 4;
holder._y = 22;
holder.loadMovie(picTitle);
holder.onLoad = function(success) {
	if(success){ 
		loadStatus.text = "";
	}else{
		loadStatus.text = "loading";
		clearInterval(checkProgress);
	}
};

checkProgress = setInterval(checkLoad, 50);

```

}

function checkLoad(){  
var obj = holder;  
var bytesLoaded = obj.getBytesLoaded();  
var bytesTotal = obj.getBytesTotal();  
var percentLoaded = (bytesLoaded/bytesTotal)\*100;  
loadBar.\_xscale = percentLoaded;  
if(bytesLoaded \>= bytesTotal){  
clearInterval(checkProgress);  
loadBar.\_xscale = 0;  
}  
}[/AS]

[AS]on(press){  
currentPic == this.pic\_array.length-1 ? currentPic=0 : currentPic++;  
loadFile(this.pic\_array[currentPic]);  
}[/AS]

---

<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:** [September 1, 2003, 9:29pm UTC](https://forum.kirupa.com/t/array-problem/29898/6 "2003-09-01T21:29:29Z")

</div>

Did the code help at all? I guess I forgot that the code to display the initial picture (which works correctly) is this:

[AS]  
loadFile(this.pic\_array[currentPic]);  
[/AS]

---

<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:** [September 2, 2003, 4:56am UTC](https://forum.kirupa.com/t/array-problem/29898/7 "2003-09-02T04:56:31Z")

</div>

Anyone? I’ve been playing with this all afternoon, and I still can’t figure it out.
