Looping through a txt file & attachMovie()

hey out there,

just read the tutorial at http://www.kirupa.com/developer/mx/externaldata.htm and it got me thinking…

i’ve gotta load of cd track listings i need to show. all the info is in text files, and i can format it to look like:

&trackInfo1=Square One
&trackInfo2=What If?

i’ve been trying to use this actionscript to loop through each track and attach it to the stage:


loadText = new LoadVars();
loadText.onLoad = function() {
	//count the number of tracks
	arrayLength = this.totalTracks;
	//each movie clip has to be offset
	vertOffset = 55;
	//loop through each value in the array
	for (i=0; i<arrayLength; i++) {
		//attach the clip
		var tClip = this.attachMovie("trackInfoMc", "track"+i, this.getNextHighestDepth());
		//set it's y position
		tClip._y = vertOffset+(tClip._y+vertOffset)*i;
		//set the txt inside the new mc to the current value
		tClip.trackInfo.text = this.trackInfo*;
		tClip.trackFile.text = this.trackFile*;

the final idea is to turn each loop into a click link that loads the mp3 into a media player - i need to get this working 1st!

at the moment, nothing appears on the timeline.

can anyone see what i’m doing wrong or am i approaching this the wrong way…

anything would be great!

many thanks,