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

**URL:** https://forum.kirupa.com/t/basic-xml-mp3-loop-not-working-help-please/190984
**Category:** flash
**Created:** [June 16, 2006, 3:46am UTC](https://forum.kirupa.com/t/basic-xml-mp3-loop-not-working-help-please/190984 "2006-06-16T03:46:20Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![YoungNastyMan](https://avatars.discourse-cdn.com/v4/letter/y/a6a055/32.png) [@YoungNastyMan](https://forum.kirupa.com/u/YoungNastyMan)
#### Post date: [June 16, 2006, 3:46am UTC](https://forum.kirupa.com/t/basic-xml-mp3-loop-not-working-help-please/190984/1 "2006-06-16T03:46:20Z")

</div>

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?

```auto

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’](http://www.davidcrockettscoins.com/index.php?main_page=page_2)).

Thanks in advance 😃
