Dynamic Button and Text Issue

I am in the process of developing a fully dynamic website, and I’m running into a large issue. I can generate multiple unique buttons from an asset I’ve got in the Library, I can assign them each their own unique text field information as well as unique text to put into another text field (which is where I"m having trouble), but for the life of me I can’t figure out how to code each button to display it’s unique text in that second text field! The issue I keep running into is AS3 won’t save a unique eventListener for each button like it does for all of the other unique pieces, so when I go to pass any variables into it, it takes the last variable that existed instead of what I would assume would be the unique one from it’s for-loop pass!


var info_history:info_popup = new info_popup();

this.addChild (info_history);
info_history.x = -24.6;
info_history.y= -111;

// trace(info_history.name);

info_history.info_txt.text = "Welcome to the Machine";

var timelineArray:Array = new Array();
var dataPublish:Array = new Array();


for (var i:Number = 0; i<5; i++) {
    
    var jewel:timeline_placeholder = new timeline_placeholder();
    jewel.placeholder = i;
    
    this.addChild (jewel);
    jewel.x = -324.5 + i*20;
    jewel.y = -324.5
    
    jewel.info_txt = "Hello World" + i;
    
    jewel.year_txt.text = "1987" +i;
    
    jewel.timeline_jewel.addEventListener(MouseEvent.CLICK, function(evt:MouseEvent) {
                                                                                  populateTimelineInfo (evt, jewel.placeholder)
                                                                                  }    );
    
    timelineArray.push(jewel);

}

function populateTimelineInfo (evt:MouseEvent, arrayHolder:Number) {
    trace (arrayHolder);
}


Any help would be greatly appreciated. I can also post up the .fla file if someone actually wants to take a look at it. The jewel.year_txt and jewel.info_txt will wind up coming from an XML file once I’ve gotten this to work. Any and all help would, again, be greatly appreciated!