# MP3 looping help

**URL:** <https://forum.kirupa.com/t/mp3-looping-help/294511>\
**Category:** flash\
**Created:** [August 15, 2009, 8:48am UTC](https://forum.kirupa.com/t/mp3-looping-help/294511 "2009-08-15T08:48:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ravyn](https://avatars.discourse-cdn.com/v4/letter/r/7993a0/32.png) [@Ravyn](https://forum.kirupa.com/u/Ravyn)\
**Post date:** [August 15, 2009, 8:48am UTC](https://forum.kirupa.com/t/mp3-looping-help/294511/1 "2009-08-15T08:48:15Z")

</div>

I used to have a single MP3 that would continuously loop on my website with the following actionscript:

```auto
x = new Sound();
x.loadSound("WITHOUT INST.mp3", true);
x.onSoundComplete = function() {
    x.loadSound("WITHOUT INST.mp3", true);
}

```

This worked perfectly for me, but now I have a second MP3 that I want to add to the loop, so I set it up like this:

```auto
x = new Sound();
x.loadSound("WITHOUT INST.mp3", true);
x.onSoundComplete = function() {
    x.loadSound("new_song.mp3", true);
}

```

In this case it plays **without inst.mp3** and then when that is complete it plays my next song ( **new\_song.mp3** ). The problem starts when **new\_song.mp3** ends. **New\_song.mp3** will repeat forever because there is not another onSoundComplete telling it to move on. My question is simple and I apologize ahead of time for not being very capable with actionscript. I want my looping background music to go like this:

1. Without inst.mp3
2. new\_song.mp3  
3 Without inst.mp3
3. etc etc etc.

I want it to play through my two tracks and start over again with the first track when the second track completes. I want it to keep repeating like this forever, or until someone hits my stop button.

Thanks for any responses.
