# \*\*\*. arrarys, finding index, loading called pic from found index

**URL:** <https://forum.kirupa.com/t/arrarys-finding-index-loading-called-pic-from-found-index/130505>\
**Category:** Uncategorized\
**Created:** [December 5, 2004, 10:25pm UTC](https://forum.kirupa.com/t/arrarys-finding-index-loading-called-pic-from-found-index/130505 "2004-12-05T22:25:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashpuppy](https://avatars.discourse-cdn.com/v4/letter/f/49beb7/32.png) [@flashpuppy](https://forum.kirupa.com/u/flashpuppy)\
**Post date:** [December 5, 2004, 10:25pm UTC](https://forum.kirupa.com/t/arrarys-finding-index-loading-called-pic-from-found-index/130505/1 "2004-12-05T22:25:10Z")

</div>

I am fairly new to flash, so thanks for bearing with me - here is my problem -

1. I have a bunch of associated arrays, populated from an xml file.

2. I have a dyn mc that displays thumbs, based on the info from the arrays.

3. if the user clicks on the thumb, I want the on release to trigger (among other things) a function that will find the index of, say, “houseID” so I can then apply that index in loading up a different(big) jpg , and other info pertinent to that thumb.  
here is my code for the button:  
on (release) {  
//carry ID being the variable passed thru “oneHouse” function  
CarryID=this.houseID;

* * *

here is code from a frame -

```
 foundIndex = findByID(CarryID);
 if (foundIndex != null) {
     /*set dynamic textbox values from Arrays
     all this stuff is not set up yet...
     txtLocation = houseLocationArray[foundIndex];
     txtBed = houseBedArray[foundIndex];
     txtBath = houseBathArray[foundIndex];
     txtPrice = housePriceArray[foundIndex];
     //set dynamic jpeg clip from value of photoArray
     loadMovie(houseBigpicArray[foundIndex], BigphotoClip);
     */
     
     trace("foundIndex!=null");
          
 }
 else{
     trace("foundIndex really=null");
 }
 
 function findByID(houseID) {
     //loop through the IDArray
     for (j=0; j&lt;houseIDArray.length; j++) {
         //if the passed argument equals an Array value...
         if (houseIDArray[j] ==houseID) {
             //return the index of the matching value
             return j;
             
         }
     }
     //if nothing is ever found, return null
     trace("foundIndex2=null");
     return null;
 }
 
 gotoAndStop("big");

```

}

thanks for anyone that can help me with this!!
