# Loading Mp3 from XML file!

**URL:** <https://forum.kirupa.com/t/loading-mp3-from-xml-file/72260>\
**Category:** Uncategorized\
**Created:** [December 3, 2004, 7:36pm UTC](https://forum.kirupa.com/t/loading-mp3-from-xml-file/72260 "2004-12-03T19:36:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JUD](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@JUD](https://forum.kirupa.com/u/JUD)\
**Post date:** [December 3, 2004, 7:36pm UTC](https://forum.kirupa.com/t/loading-mp3-from-xml-file/72260/1 "2004-12-03T19:36:24Z")

</div>

Hi all…

I’m trying to load mp3 files from an xml playlist but they are not playing when I want them to. All the mp3’s are in the same directory as the swf and play ok when I simply load them with a basic Sound object, but not when I try and load them from the xml file.

Here is my xml:

```auto
<Mp3Player>
  <Song Artist="blah" Title="blah" Path="track1.mp3" />
  <Song Artist="blah" Title="blah" Path="track2.mp3" />
  <Song Artist="blah" Title="blah" Path="track3.mp3" />
  </Mp3Player>
  

```

And my Actionscript:  
[AS] var tracks:XML = new XML();  
tracks.onLoad = function(success){  
if(success){  
//This traces all the paths and works fine  
for(var i = 0; i \< tracks.firstChild.childNodes.length; i++){  
trace(tracks.firstChild.childNodes\*.attributes.Path);  
}  
var s:Sound = new Sound(this);  
s.loadSound(tracks.firstChild.childNodes[0].attributes.Path, true);  
}  
}  
tracks.load(“tracks.xml”);[/AS]

Basically, all I’m trying to do is get track1.mp3 to play when the xml file has loaded, but I can’t understand why it doesn’t!!

Any help will be much appreciated  
Thanks in advance

JUD
