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

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;

    trace(“houseid”+houseID);
    _parent.oneHouse(CarryID)
    //“big” being the frame label
    _parent.play(“big”)
    }


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<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!!