Dynamically created onLoad event problem

I have this code inside a for loop which is inside a function:


_root["track" + i] = new Sound();
_root["track" + i].loadSound(extTracks.data.tracks*, false);
createOnLoad("track" + i);

The createOnLoad function looks like this:


function createOnLoad(tempName:String) {
	_root[tempName].onLoad = function() {
		var duration:Number = this.duration / 1000;
		var minutes:Number = Math.floor(duration / 60);
		var seconds:Number = Math.floor(duration - minutes * 60);
		var trackTitle:String = this.id3.artist + " - " + this.id3.TIT2;

		trackList_mc.trackButtons_mc[tempName + "_mc"].details_txt.text = trackTitle.toUpperCase();
		trackList_mc.trackButtons_mc[tempName + "_mc"].length_txt.text = minutes + ":" + seconds;
	};
}

When i test the movie in flash itself everything works fine, but when i open the movie in IE or the stand alone flash player, details_txt and length_txt are both empty. Does anyone have any idea why?

Thanks,
Brendan Smith