Buttons with dynamic names and links, XML

Hello,
I’ve been trying to set this up for a couple days. The raw data is imported from an XML file. This is a calendar that will update daily.

Some days will have links and some days won’t, on the days that have links I want actionscript to make buttons for the links. So far, I can create the buttons, but all the links and buttons are the same as the last link in the list.

The basic code follows:


function setInfo() {
		   createTextFields(0,0,"classDate_txt",400);
		   classDate_txt.autoSize = true;
		   classDate_txt.htmlText = this.nextClass*;
		   createTextFields(0,30,"classTopic_txt",400);
		   classTopic_txt.autoSize = true;
		   classTopic_txt.htmlText = this.topic*;
		   createTextFields(0,55,"assignments_txt",400);
		   assignments_txt.autoSize = true;
		   assignments_txt.wordWrap = true;
		   assignments_txt.htmlText = "Assignments Due: "+this.assignments*;
		   b = assignments_txt._height;
		   c = assignments_txt._y;
		   createTextFields(0,b+c+10,"reading_txt",400);
		   reading_txt.autoSize = true;
		   reading_txt.wordWrap = true;
		   reading_txt.htmlText = "Reading: "+this.readings*;
		  if (guests* != 0) {
			   d = reading_txt._height;
		       e = reading_txt._y;
createTextFields(0,d+e+10,"guest_txt",400);
			   guest_txt.autoSize = true;
guest_txt.wordWrap = true;
guest_txt.htmlText = "Guest Speaker: "+this.guests*;
		   }
			createTextFields(410,assignments_txt._y,"notes_txt",200);
			notes_txt.autoSize = true;
		  notes_txt.wordWrap = true;
		  notes_txt.htmlText = "Notes: "+this.notes*;   
			  f = notes_txt._height;
			  g = notes_txt._y;
			 newY = f+g-15;
			  linksLength = links*.length;
		      if (links* != 0) {
				  for (k=0; k<linksLength; k++) {
var link_mc = date_mc.duplicateMovieClip("link_mc"+k, this.getNextHighestDepth());
	link_mc._x = 410;
	link_mc._y = newY+=15;
	 link_mc.beginFill(0xFF00FF, 100);
	 link_mc.lineStyle(1, 0x000000);
	link_mc.lineTo(0,0);
	link_mc.lineTo(200, 0);
	link_mc.lineTo(200, 20);
	link_mc.lineTo(0, 20);
	link_mc.lineTo(0,0);
	link_mc.endFill();
	link_mc._alpha = 10;
					
this.createTextFields(0,0,"link_txt"+k,300);
	 var newLink = ["link_txt"+k];
	newLink.htmlText.html = true;
	newLink.htmlText.border = true;
	 newLink.htmlText = links*[k];
	newLink.htmlText._y = newY+=10;
	newLink.htmlText._x = 0;
	var newText = links*[k];
	newLink._y = link_mc._y;
	 link_txt0._x = link_mc0._x;
	link_txt0.htmlText = newText;
	link_txt1._y = 275;
	link_txt1.htmlText = newText;
	newLink.htmlText = links*[k];
	trace(link_mc);
	trace(newText);
	
link_mc.onRelease = function () {
	getURL(newText);
	trace(link_mc);
	trace(newText);
				   }
						
				 }
				 
					
						
		   }
}

I attached the fla and xml file.