# Xml mp3 question

**URL:** <https://forum.kirupa.com/t/xml-mp3-question/276034>\
**Category:** Uncategorized\
**Created:** [November 21, 2008, 3:29pm UTC](https://forum.kirupa.com/t/xml-mp3-question/276034 "2008-11-21T15:29:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![neil\_c](https://avatars.discourse-cdn.com/v4/letter/n/5daacb/32.png) [@neil\_c](https://forum.kirupa.com/u/neil_c)\
**Post date:** [November 21, 2008, 3:29pm UTC](https://forum.kirupa.com/t/xml-mp3-question/276034/1 "2008-11-21T15:29:22Z")

</div>

Im new to this forum! so firstly like to say a big hello to everyone!

I’m not quite sure how to explain what i am wanting to achieve so i will type out a simple diagram below.  
[COLOR=navy][/COLOR]  
[COLOR=navy]My XML File[/COLOR]  
[COLOR=green]\<songs\>[/COLOR]  
[COLOR=green] \<song\>track1.mp3\</song\>[/COLOR]  
[COLOR=green] \<song\>track2.mp3\</song\>[/COLOR]  
[COLOR=green] \<song\>track2.mp3\</song\>[/COLOR]  
[COLOR=green]\</song\>[/COLOR]  
[COLOR=#ff0000][/COLOR]  
[COLOR=navy]Flash[/COLOR]  
[COLOR=black]track1.mp3 to stream at start[/COLOR]  
[COLOR=red]Button 1 [/COLOR][COLOR=black]- [COLOR=darkred]stops currently playing song and[/COLOR] [COLOR=darkred]streams track1.mp3[/COLOR][/COLOR]  
[COLOR=#8b0000][COLOR=red]Button 2[/COLOR] [COLOR=black]-[/COLOR] [/COLOR][COLOR=darkred]stops currently playing song and streams track2.mp3[/COLOR]  
[COLOR=#8b0000][COLOR=red]Button 3[/COLOR] [COLOR=black]-[/COLOR] stops currently playing song and streams track3.mp3[/COLOR]  
[COLOR=#8b0000]-------------------------------------------------------------[/COLOR]  
[COLOR=#8b0000][/COLOR]  
[COLOR=black]Haha, it looks so simple when written out like that… [/COLOR]  
I’ve given it ago myself using Flash CS3 and actionscript 2.0 and come out with this, but it doesnt work?

[COLOR=teal]xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“tracks.xml”);[/COLOR]  
[COLOR=teal]function loadXML (loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
s = [];  
for (i=0; i\<total; i++) {  
s[1] = xmlNode.childNodes[0].firstChild.nodeValue;  
s[2] = xmlNode.childNodes[1].firstChild.nodeValue;  
}  
s1audio();  
}

else {  
error\_txt = “Error Loading Tracks”;  
}  
}[/COLOR]  
[COLOR=teal]//track1  
s1audio = function() {  
\_root.audio\_mc.loadSound(s[1].earl, true);  
}[/COLOR]  
[COLOR=teal]s1\_play.onRelease = function() {  
s1audio();  
}[/COLOR]  
[COLOR=teal]//track2  
s2\_play.onRelease = function() {  
\_root.audio\_mc.loadSound(s[2].earl, true);  
}[/COLOR]

[COLOR=black]Hope someone can help me out here…[/COLOR]  
Thanks in advance,  
Neil Carpenter
