# MP3 Player v2 - XML

**URL:** https://forum.kirupa.com/t/mp3-player-v2-xml/44539
**Category:** design
**Created:** [March 4, 2004, 8:25pm UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539 "2004-03-04T20:25:36Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 4, 2004, 6:21pm UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/21 "2004-08-04T18:21:39Z")

</div>

I give up. Maybe I’m just not meant to have an mp3 player on my site. I’ll just use the method I used before where the songs are in the fla and there are buttons for each track. Thanks anyway voets.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 4, 2004, 6:58pm UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/22 "2004-08-04T18:58:10Z")

</div>

Aw man, don’t give up ! Just recreate that zip, I’ll be delighted to help, but I can’t do much with a ZIP that’s corrupt !

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 5, 2004, 12:46am UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/23 "2004-08-05T00:46:52Z")

</div>

> [@Voetsjoeba](#):
>
> Replace the next prototype by this one, and then you can use it to play a specific song by targetting the instance of the class, ‘player’ and executing the next method, passing along the number you want:
> 
> player.next(7);
> 
> ```auto
> mp3Player.prototype.next = function(nr) {
> this.sound.stop();
> if(nr){
> this.songs.index = nr;
> } else {
> this.songs.index++;
> if (this.songs.index>this.songs.length-1) {
> this.songs.index = 0;
> }
> }
> this.showSongInfo();
> this.sound = new Object(new Sound(_root));
> this.sound.loadSound(this.songs[this.songs.index].url, true);
> this.sound.setVolume(this.curVolume);
> this.showLoaded();
> this.indicateStatus(1);
> this.indicateProgress();
> };
> 
> ```

THANKS MAN!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 5, 2004, 2:24am UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/24 "2004-08-05T02:24:03Z")

</div>

plantain\_tart,

tired out the code… “it verks” just wanted to say thanks for posting it… **this is truly one of the best mp3 players i’ve seen on the net… BIG BIG PROPS Voetsjoeba!!**

is there any way to display the time remaining??? ( example: 2:31 )

thanks in advance…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 5, 2004, 7:42am UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/25 "2004-08-05T07:42:23Z")

</div>

Time remaining eh ? Yeah that should be possible. Lemme look into that. Isn’t there the status bar to indicate how much of the song there is to play ?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 5, 2004, 12:44pm UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/26 "2004-08-05T12:44:12Z")

</div>

> [@Voetsjoeba](#):
>
> Time remaining eh ? Yeah that should be possible. Lemme look into that. Isn’t there the status bar to indicate how much of the song there is to play ?

There is a status bar… I guess i just am asking for too much… i do appericate you sharing this file, please don’t think i’m taking that for granted.

[http://www.xplodingplastix.com/](http://www.xplodingplastix.com/) ( **click on music** ) This is another cool mp3 player … that loads the album cover and displays time remaining.

Your player does have a status bar w/ a slider option (COOL) [xplodingplastix.com](http://xplodingplastix.com)’s player one does not.

Appericate all you’ve done Voetsjoeba, thank you.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 5, 2004, 2:14pm UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/27 "2004-08-05T14:14:51Z")

</div>

> [@Voetsjoeba](#):
>
> Aw man, don’t give up ! Just recreate that zip, I’ll be delighted to help, but I can’t do much with a ZIP that’s corrupt !

What did you use to open it? I tried WinZip and WinRar and it worked perfectly in both.

Try this instead:  
[http://www.freewebs.com/showcasesite/mp3fla.zip](http://www.freewebs.com/showcasesite/mp3fla.zip)

or again:  
[http://www.freewebs.com/showcasesite/ZipforVoetsjoeba.zip](http://www.freewebs.com/showcasesite/ZipforVoetsjoeba.zip)

I hope one of these works.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 5, 2004, 2:33pm UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/28 "2004-08-05T14:33:47Z")

</div>

Heh, pretty simple why - you have an error in your XML file. There are these -'s in them that cause errors. Here’s what it should look like:

```auto
<?xml version="1.0" encoding="iso-8859-1" ?> 
<playlist>
<song title="You're So Last Summer" artist="Taking Back Sunday">
<![CDATA[C:\My Documents\Mp\3Taking Back Sunday (Tell All Your Friends 09) - You're So Last Summer.mp3]]> 
</song>
</playlist>

```

And, there’s an error in the path to the mp3 - My Documents\Mp\3… should be My Documents\Mp3…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 5, 2004, 3:04pm UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/29 "2004-08-05T15:04:55Z")

</div>

Thanks Voets. I’m very greatful for your time. You must get so bored of answering questions for n00bs like me.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 5, 2004, 3:40pm UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/30 "2004-08-05T15:40:24Z")

</div>

It’s still not working!!

Okay, I changed the xml file like you said but the error panel stil says

```auto
Error opening URL "<A href="file:///C|/My%20Documents/undefined"[/CODE">file:///C|/My%20Documents/undefined"

```

The thing is, that URL doesn’t appear anywhere in my actionscript.  
Here’s the XML loading code I have currently:

```auto
 
XMLRetrieve = new XML();
XMLRetrieve.ignoreWhite = true;
XMLRetrieve.load("[http://www.freewebs.com/showcasesite/onlineplaylist.xml](http://www.freewebs.com/showcasesite/onlineplaylist.xml)");
XMLRetrieve.onLoad = function() {
for (var j = 0; j<this.firstChild.childNodes.length; j++) {
songsArray.push({title:this.firstChild.childNodes[j].attributes.title, artist:this.firstChild.childNodes[j].attributes.artist, [url:this.firstChild.childNodes](http://www.kirupaforum.com/forums/this.firstChild.childNodes)[j].firstChild.nodeValue});
}
player = new mp3Player(songsArray, playerInterface, 1);
};

```

What’s wrong with this code? Or is the fault somewhere else?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 12, 2004, 11:50am UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/31 "2004-08-12T11:50:47Z")

</div>

Hi,

Good idea with the jukebox, as far as the XML file is concerned, I have a question.

\<song title=“No Holly For Miss Quinn” artist=“Enya”\>\<![CDATA[[http://www.kieto.com/noholly.mp3](http://www.kieto.com/noholly.mp3)]]\>\</song\>

Do I put the link to the file in the CDATA part? I’m a little confused.

Cheers

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 12, 2004, 3:07pm UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/32 "2004-08-12T15:07:54Z")

</div>

Yeah, the link goes inbetween \<![CDATA[and]]\>. The whole CDATA thing is to ensure that the text inbetween doesn’t get parsed by the XML parser. For regular URLs this shouldn’t be a problem, but there are some weird URLs out there. So to be sure, I used this.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 12, 2004, 3:13pm UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/33 "2004-08-12T15:13:41Z")

</div>

Cheers, when I have finished it I will show you how I am using it, do you want credit for it?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 12, 2004, 3:26pm UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/34 "2004-08-12T15:26:16Z")

</div>

Whatever you like. If you feel like doing so, then do so, if you don’t, then don’t.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 12, 2004, 10:03pm UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/35 "2004-08-12T22:03:40Z")

</div>

Ok, thanks.

A few questions though, if you don’t mind, but I want to be able to stream the mp3’s that I play, because I would like the music to start as soon as the site loads, but I have my jukebox in its own MC. So my preloader loads in all the movie, but it doesn’t load the external music.

Any ideas

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 12, 2004, 10:38pm UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/36 "2004-08-12T22:38:10Z")

</div>

Help whats going on here?

Its the streaming version.

[http://www.thepearl.co.uk/test.htm](http://www.thepearl.co.uk/test.htm)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 13, 2004, 7:13am UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/37 "2004-08-13T07:13:30Z")

</div>

Wow, this is weird. All that flashing of the titles. Make sure that the paths you provide in the code are correct. Because you’ve placed it in another movieclip, you’ve gotta double check your paths (at the bottom of the code, above the XML part).

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 13, 2004, 7:44am UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/38 "2004-08-13T07:44:43Z")

</div>

```auto

// mp3Player class
_soundbuftime = 1;
mp3Player = function (songs, interF, reservedDepth) {
	if (songs != undefined && interF != undefined && reservedDepth != undefined && typeof songs == "object" && typeof interF == "object" && typeof reservedDepth == "number") {
		this.sound = new Object(new Sound(_root));
		this.songs = songs;
		this.player = interF;
		this.positionDump = 0;
		this.songs.index = 0;
		this.sound.paused = false;
		this.sound.stopped = false;
		this.curVolume = 100;
		this.player.songInfo.html = true;
		this.player.songInfo.condenseWhite = true;
		this.player.songInfo.autoSize = "center";
		this.safeDepth = reservedDepth-1;
		this.player.progressIndicator.offset = this.player.progressIndicator._x;
		this.loadHandler = _root.createEmptyMovieClip("LH", ++this.safeDepth);
		this.progressHandler = _root.createEmptyMovieClip("PH", ++this.safeDepth);
		this.volumeHandler = _root.createEmptyMovieClip("VH", this.safeDepth+3);
		this.volumeSlideHandler = _root.createEmptyMovieClip("VSH", ++this.safeDepth+4);
		// Start functions ----------------------------------------------------------------------------------------------------
		this.setRollOver(1);
		this.setControls();
		this.setInitialVolume(100);
		this.sound.loadSound(this.songs[this.songs.index].url, true);
		this.showLoaded();
		this.showSongInfo();
		this.indicateStatus(1);
		this.indicateProgress();
		// this.enableDrag();
		// 
	} else {
		trace("Invalid parameter(s) specified.");
	}
};
mp3Player.prototype.stopProgressIndicator = function() {
	delete this.progressHandler.onEnterFrame;
};
mp3Player.prototype.resetProgressIndicator = function() {
	delete this.progressHandler.onEnterFrame;
	this.player.progressIndicator._x = this.player.progressIndicator.offset;
};
mp3Player.prototype.disableDrag = function() {
	delete this.player.progressIndicator.onPress;
	delete this.player.progressIndicator.onRelease;
	delete this.player.progressIndicator.onReleaseOutside;
};
mp3Player.prototype.indicateStatus = function(stat) {
	var tar;
	stat>0 ? tar=_root.jukeBox.playBtn : stat+1 ? tar=_root.jukeBox.pauseBtn : this.player.statusIndicator.easeX(tar._x);
};
mp3Player.prototype.showSongInfo = function() {
	var artist = this.songs[this.songs.index].artist;
	var title = this.songs[this.songs.index].title;
	var output = artist+" - "+title;
	this.player.songInfo.htmlText = output;
};
mp3Player.prototype.next = function() {
	this.sound.stop();
	this.songs.index++;
	if (this.songs.index>this.songs.length-1) {
		this.songs.index = 0;
	}
	this.showSongInfo();
	this.sound = new Object(new Sound(_root));
	this.sound.loadSound(this.songs[this.songs.index].url, true);
	this.sound.setVolume(this.curVolume);
	this.showLoaded();
	this.indicateStatus(1);
	this.indicateProgress();
};
mp3Player.prototype.setInitialVolume = function(x) {
	var ref = this;
	var tgt = x/100*this.player.volumeHeight;
	var vitgt = this.player.volumeBar._y-tgt;
	this.player.volumeNR.text = 100;
	this.sound.setVolume(x);
	this.curVolume = x;
	this.volumeHandler.onEnterFrame = function() {
		ref.player.volumeIndicator._y = vitgt-(vitgt-ref.player.volumeIndicator._y)/1.2;
		ref.player.volumeBar._height = tgt-(tgt-ref.player.volumeBar._height)/1.2;
		if (ref.player.volumeIndicator._y>vitgt-1 && ref.player.volumeIndicator._y<vitgt+1 && ref.player.volumeBar._height>tgt-1 && ref.player.volumeBar._height<tgt+1) {
			delete this.onEnterFrame;
		}
	};
};
mp3Player.prototype.setVolumeDrag = function(x) {
	if (x>100) {
		x = 100;
	}
	if (x<0) {
		x = 0;
	}
	var ref = this;
	var tgt = x/100*this.player.volumeHeight;
	this.sound.setVolume(x);
	this.curVolume = x;
	this.player.volumeNR.text = Math.round(x);
	this.volumeHandler.onEnterFrame = function() {
		ref.player.volumeBar._height = tgt-(tgt-ref.player.volumeBar._height)/1.2;
		if (ref.player.volumeBar._height>tgt-1 && ref.player.volumeBar._height<tgt+1) {
			delete this.onEnterFrame;
		}
	};
};
mp3Player.prototype.dragVolumeSlider = function() {
	var ref = this;
	var maxH = this.player.volumeHeight;
	var vi = this.player.volumeIndicator;
	var vb = this.player.volumeBar;
	this.volumeSlideHandler.onEnterFrame = function() {
		conv = {x:0, y:_root._ymouse};
		globalToLocal(conv);
		this._y = conv.y;
		if (conv.y>=vb._y-maxH-1 && conv.y<=vb._y+1) {
			vi._y = conv.y;
			ref.setVolumeDrag((vb._y-conv.y)*100/maxH);
		}
	};
};
mp3Player.prototype.previous = function() {
	this.sound.stop();
	this.songs.index--;
	if (this.songs.index<0) {
		this.songs.index = this.songs.length-1;
	}
	this.showSongInfo();
	this.sound = new Object(new Sound(_root));
	this.sound.loadSound(this.songs[this.songs.index].url, true);
	this.sound.setVolume(this.curVolume);
	this.showLoaded();
	this.indicateStatus(1);
	this.indicateProgress();
};
mp3Player.prototype.indicateProgress = function() {
	var ref = this;
	this.progressHandler.onEnterFrame = function() {
		var played = ref.sound.position;
		var total = ref.songs[ref.songs.index].duration;
		ref.player.progressIndicator._x = ref.player.progressIndicator.offset+((played/total)*ref.player.loadWidth);
		if (played>=total) {
			delete this.onEnterFrame;
			ref.resetProgressIndicator();
			ref.next();
		}
	};
};
mp3Player.prototype.showLoaded = function() {
	var ref = this;
	this.loadHandler.onEnterFrame = function() {
		var loaded = ref.sound.getBytesLoaded();
		var total = ref.songs[ref.songs.index].totalbytes;
		ref.player.loadBar._width = (loaded/total)*ref.player.loadWidth;
		if (loaded == total) {
			delete this.onEnterFrame;
		}
	};
};
mp3Player.prototype.setControls = function() {
	var ref = this;
	var playB = _root.jukeBox.playBtn;
	var prevB = _root.jukeBox.previousBtn;
	var nextB = _root.jukeBox.nextBtn;
	var pauseB = _root.jukeBox.pauseBtn;
	pauseB.onRelease = function() {
		if (!ref.sound.stopped) {
			ref.sound.stop();
			ref.indicateStatus(0);
			ref.sound.paused = true;
			ref.sound.stopped = false;
			ref.sound.pausedPosition = ref.sound.position;
			ref.stopProgressIndicator();
		}
	};
	stopB.onRelease = function() {
		ref.sound.stop();
		ref.indicateStatus(-1);
		ref.sound.stopped = true;
		ref.sound.paused = false;
		ref.sound.pausedPosition = 0;
		ref.resetProgressIndicator();
	};
	playB.onRelease = function() {
		if (ref.sound.stopped) {
			ref.indicateProgress();
			ref.indicateStatus(1);
			ref.sound.start(0, 1);
			ref.sound.stopped = false;
		} else if (ref.sound.paused) {
			ref.indicateProgress();
			ref.indicateStatus(1);
			ref.sound.start(ref.sound.pausedPosition/1000, 1);
			ref.sound.paused = false;
		}
	};
	nextB.onRelease = function() {
		ref.resetProgressIndicator();
		ref.next();
	};
	prevB.onRelease = function() {
		ref.resetProgressIndicator();
		ref.previous();
	};
};
mp3Player.prototype.enableDrag = function() {
	var ref = this;
	this.player.progressIndicator.onPress = function() {
		ref.sound.stop();
		ref.stopProgressIndicator();
		ref.indicateStatus(0);
		ref.sound.paused = true;
		ref.sound.stopped = false;
		total = ref.songs[ref.songs.index].duration;
		this.onEnterFrame = function() {
			conv = {x:_root._xmouse};
			globalToLocal(conv);
			this._x = conv.x;
			if (conv.x<ref.player.loadBar._x) {
				this._x = ref.player.loadBar._x;
			}
			if (conv.x>ref.player.loadBar._x+ref.player.loadWidth) {
				this._x = ref.player.loadBar._x+ref.player.loadWidth;
			}
			var percent = ((this._x-ref.player.loadBar._x)/ref.player.loadWidth)*100;
			this.newPosition = (percent*total)/100;
		};
	};
	this.player.progressIndicator.onRelease = this.player.progressIndicator.onReleaseOutside=function () {
		if (this.newPosition>=ref.songs[ref.songs.index].duration) {
			this.newPosition = ref.songs[ref.songs.index].duration-1;
		}
		delete this.onEnterFrame;
		ref.sound.start(ref.player.progressIndicator.newPosition/1000, 1);
		ref.sound.paused = false;
		ref.sound.stopped = false;
		ref.indicateStatus(1);
		ref.indicateProgress();
	};
};
//prototypes
MovieClip.prototype.fadeIn = function() {
	this.onEnterFrame = function() {
		this._alpha += 2;
		this._alpha>=100 ? delete this.onEnterFrame : null;
	};
};
MovieClip.prototype.fadeOut = function() {
	this.onEnterFrame = function() {
		this._alpha -= 2;
		this._alpha<=30 ? delete this.onEnterFrame : null;
	};
};

// creation of mp3Player class instance and junk
songsArray = new Array();
playerInterface = new Object();
playerInterface.playButton = _root.jukeBox.playBtn;
playerInterface.pauseButton = _root.jukeBox.pauseBtn;
playerInterface.previousButton = _root.jukeBox.previousBtn;
playerInterface.nextButton = _root.jukeBox.nextBtn;
playerInterface.loadBar = _root.jukeBox.loadbar;
playerInterface.loadWidth = 165;
playerInterface.progressIndicator = this.proIndic;
playerInterface.statusIndicator = this.statusIndic;
playerInterface.songInfo = this.songInfo;
playerInterface.volumeBar = this.volumeBar;
playerInterface.volumeNR = this.volumeNR;
playerInterface.volumeIndicator = this.volumeIndic;
playerInterface.volumeHeight = 60;
//---------------------------------------------------
XMLRetrieve = new XML();
XMLRetrieve.ignoreWhite = true;
XMLRetrieve.load("onlineplaylist.xml");
XMLRetrieve.onLoad = function() {
	for (var j = 0; j<this.firstChild.childNodes.length; j++) {
		/* Handle duration and convert to milliseconds */
		dur = this.firstChild.childNodes[j].attributes.duration;
		dblPnt = dur.indexOf(":");
		mins = Number(dur.substr(0, dblPnt));
		sec = Number(dur.substr(dblPnt+1, dur.length));
		ms = ((mins*60)+sec)*1000;
		/* Handle filesize and convert to bytes */
		songsArray.push({title:this.firstChild.childNodes[j].attributes.title, url:this.firstChild.childNodes[j].firstChild.nodeValue});
	}
	player = new mp3Player(songsArray, playerInterface, 1);
};

```

Thanks

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 13, 2004, 8:03am UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/39 "2004-08-13T08:03:37Z")

</div>

I know the code, it’s your FLA I’d have to see to know the structure.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 13, 2004, 8:21am UTC](https://forum.kirupa.com/t/mp3-player-v2-xml/44539/40 "2004-08-13T08:21:08Z")

</div>

here is a completely stripped down version of the fla.

Thanks

[Previous page](https://forum.kirupa.com/t/mp3-player-v2-xml/44539.md?page=1)

[Next page](https://forum.kirupa.com/t/mp3-player-v2-xml/44539.md?page=3)
