# Matching items in an array to Movie Clip labels

**URL:** <https://forum.kirupa.com/t/matching-items-in-an-array-to-movie-clip-labels/327112>\
**Category:** flash\
**Created:** [February 6, 2012, 6:48pm UTC](https://forum.kirupa.com/t/matching-items-in-an-array-to-movie-clip-labels/327112 "2012-02-06T18:48:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alemieux34](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@alemieux34](https://forum.kirupa.com/u/alemieux34)\
**Post date:** [February 6, 2012, 6:48pm UTC](https://forum.kirupa.com/t/matching-items-in-an-array-to-movie-clip-labels/327112/1 "2012-02-06T18:48:01Z")

</div>

I have an array that holds a list of items. In a movie clip, I have that same list as the frame labels. I’m using a for loop to iterate through the array and then assigning event listeners so that when you roll over an icon, it sends the movie clip to the right frame label (matching the item in the array).

However, the code I have now only returns the first match and not any of the others. Here’s my code:

```auto
for (var j:uint = 0; j<interiorCallouts.length; j++) {
    featureTextArray[j].text = interiorCallouts[j];
    featureArray.length = interiorCallouts.length;
    featureArray[j].visible = true;
    
    trace(interiorCallouts[j]);
    featureArray[j].addEventListener(MouseEvent.ROLL_OVER, showCallout);
    featureArray[j].addEventListener(MouseEvent.ROLL_OUT, hideCallout);
    
    function showCallout(e:MouseEvent):void {
        callouts_mc.visible = true;
        callouts_mc.gotoAndStop(interiorCallouts[j]);
    }
    function hideCallout(e:MouseEvent):void {
        callouts_mc.visible = false;
    }
}

```

See the showCallout function. I’m using the interiorCallouts array to match the frame label in the callouts\_mc, but I’m only getting the first match. None of the others.
