# XML mp3 player

**URL:** <https://forum.kirupa.com/t/xml-mp3-player/188182>\
**Category:** flash\
**Created:** [May 5, 2006, 4:59am UTC](https://forum.kirupa.com/t/xml-mp3-player/188182 "2006-05-05T04:59:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jimmy\_James](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@Jimmy\_James](https://forum.kirupa.com/u/Jimmy_James)\
**Post date:** [May 5, 2006, 4:59am UTC](https://forum.kirupa.com/t/xml-mp3-player/188182/1 "2006-05-05T04:59:56Z")

</div>

Well im creating a XML mpr player because every was ranting and raving about how easy they are to create so i made the late out and wen came the the action script and XML file they just dont work and no music plays can any one tell me why heres my AS and my XML thanks:

Actionscript:  
playlist = new XML();  
playlist.ignoreWhite = true;  
playlist.onload = function (success) {  
\_global.songname = [];  
\_global.songfile = [];  
trace(songfile);  
if(success) {  
for (var i=0; i\<playlist.firstChild.childNodes.length; i++) {  
\_global.songname\* = playlist.firstChild.childNodes\*.attributes.name;  
\_global.songfile\* = playlist.firstChild.childNodes\*.attributes.file;  
}  
} else {display\_txt.text=“Error loading XML”}  
}  
playlist.load(“playlist.xml”);  
\_root.createEmptyMovieClip(“sound\_mc”,1);  
\_root.sound\_mc.sound\_obj = new Sound();  
\_root.sound\_mc.songStarter(songfile[0],songname[0]);  
MovieClip.prototype.songStarter= function (file, name) {  
this.sound\_obj.loadSound(file,true) // true = streaming  
this.onEnterFrame = function () { // onEnter Frame event  
if(this.sound\_obj.position\>0) { //When sound starts  
delete this.onEnterFrame; // delete the event  
trace(“Song has started”);//Just checking if everything works  
}  
}  
}

XML:  
\<?xml version=‘1.0’ encoding=‘utf-8’?\>  
\<songs\>  
\<song name=“Not Now” file=“16 Not Now.wma” /\>  
\<song name=“Not Now” file=“stuck in America.wma” /\>  
\</songs\>

Thanks heaps Jimmy
