My MP3 player is giving funny timings little help please


Having a few issues with an mp3 player Ive created, right now im just trying to make it so that when an mp3 file is complete the next mp3 file (definied in an XML file) will play, but the counter is not working properly - script below:

var the_mp3:Sound = new Sound();
songPos = the_mp3.position;

the_mp3.onSoundComplete = songFin;

function songFin() {
	songPos = 0;
	the_mp3.onSoundComplete = Null;

function songPrep() {
	if (s == totalSongs) {
		s = 0;
function formatTime(milliseconds) {
	var seconds = Math.floor(milliseconds/1000);
	var minutes = Math.floor(seconds/60);
	seconds %= 60;
	if (seconds<10) {
		seconds = "0"+seconds;
	if (minutes<10) {
		minutes = "0"+minutes;
	return minutes+":"+seconds;

function updateTime() {
	elapsed = formatTime(songPos);

	if (this.display_panel.time_txt.text != elapsed) {
		this.display_panel.time_txt.text = elapsed;
onEnterFrame = function () {

Ok so this script work as much as skipping to another song once the current one has finished, but the counter showing the elapsed time wont reset to 0 The sound clip im using to test is 10secs long but when the 2nd song plays, the elapsed time starts at 10.
Look at my zip file ive attached.

Im sure its something simple, thanks again in advance!