Basic XML MP3 Loop not working... Help please :)

Hello everybody. I made this fairly basic MP3 player that only plays one song. I would like it to loop a whole bunch of times but I can only get it to play once.

The following is the code I’m using, can anyone help me out?


var myMusic:XML = new XML ();
myMusic.ignoreWhite = true;
myMusic.onLoad = function (success) {
  xmlNode = this.firstChild;
  song = [];
  total = xmlNode.childNodes.length;
  for (i=0; i<total; i++) {
   song* = xmlNode.childNodes*.firstChild.nodeValue;
 }
}
myMusic.load("[http://127.0.0.1/picViewer/music.php](http://127.0.0.1/picViewer/music.php)");
 
function playSong () {
 if (btns_mc.light_mc._currentframe == 1) {
 bground_music = new Sound();
 bground_music.loadSound(''+song[0]+'', true);
 bground_music.start (0, 999);
 btns_mc.light_mc.gotoAndStop(2);
 }
 else {
 bground_music.stop();
 btns_mc.light_mc.gotoAndStop(1);
 }
}

See it in action here (click on ‘My Picture Viewer’).

Thanks in advance :smiley: