# Help with my mp3 player

**URL:** <https://forum.kirupa.com/t/help-with-my-mp3-player/239478>\
**Category:** Uncategorized\
**Created:** [September 22, 2007, 6:32am UTC](https://forum.kirupa.com/t/help-with-my-mp3-player/239478 "2007-09-22T06:32:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthewdaniels](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@matthewdaniels](https://forum.kirupa.com/u/matthewdaniels)\
**Post date:** [September 22, 2007, 6:32am UTC](https://forum.kirupa.com/t/help-with-my-mp3-player/239478/1 "2007-09-22T06:32:17Z")

</div>

i had a friend create an mp3 player for me,  
unfortionatly, the way its set up, once one song ends, it just stops. i need it to go on and play the next…

heres my code below, anyone have any ideas to do this?

rightClickMenu = new ContextMenu();  
rightClickMenu.hideBuiltInItems();  
\_root.menu = rightClickMenu;

/////////////////////////////////////  
count = 0  
/////////////////////////////////////

playlist\_xml = new XML();  
playlist\_xml.ignoreWhite = true;  
playlist\_xml.load(“xml/playlist.xml”);  
playlist\_xml.onLoad = function(success:Boolean) {  
if (success) {  
\_root.mp3file = []  
xmlNode = this.firstChild;  
totalxmlNode = xmlNode.childNodes.length;  
for(var a=0;a\<totalxmlNode;a++) {  
\_root.mp3file[a] = xmlNode.childNodes[a].attributes.file  
}  
}  
makeSound()

};

/////////////////////////////////////  
musicSound = new Sound();  
function makeSound() {  
btnPlayPause.gotoAndStop(3)  
musicSound.loadSound(mp3file[count], true);  
musicSound.onID3 = function () {  
artistName = musicSound.id3.TPE1  
titleName = musicSound.id3.TIT2  
}

}

checkOnEnterFrame = function () {  
if(!pauseSound) {  
var pct:Number = Math.round(musicSound.getBytesLoaded()/musicSound.getBytesTotal() \* 100);  
var pos:Number = Math.round(musicSound.position/musicSound.duration \* pct);

```
clipLoader._width = (pct/100) * clipLoaderBg._width
clipPos._width = (pos/100) * clipLoaderBg._width
}

titleField.text = artistName + " - " + titleName + " " + artistName + " - " + titleName;

///////////// move artist - title from left to right // start

if(titleField.hscroll == 0) {
    goLeft = true
}else if(titleField.hscroll == titleField.maxhscroll) {
    goLeft = undefined
}

if(goLeft) {
    titleField.hscroll += 10
}else{
    titleField.hscroll -= 10
}
///////////// move from left to right // end

```

}  
//////////////  
musicSound.onSoundComplete = function() {  
if(count \< totalxmlNode-1) {  
clipPos.\_width = 0  
count++  
}else{  
count = 0  
}  
delete musicSound;  
musicSound = new Sound();  
makeSound();  
};

btnNext.onRelease = function () {  
clipPos.\_width = 0  
musicSound.stop()  
if(count \< totalxmlNode-1) {  
count++  
}else{  
count = 0  
}  
delete musicSound;  
musicSound = new Sound();  
makeSound();  
}

btnPrev.onRelease = function () {  
clipPos.\_width = 0  
musicSound.stop()  
if(count \> 0) {  
count–  
}else{  
count = totalxmlNode-1  
}  
delete musicSound;  
musicSound = new Sound();  
makeSound();  
}

\_root.onEnterFrame = checkOnEnterFrame;
