# MP3 Player - problem

**URL:** <https://forum.kirupa.com/t/mp3-player-problem/88643>\
**Category:** flash\
**Created:** [May 1, 2005, 9:23am UTC](https://forum.kirupa.com/t/mp3-player-problem/88643 "2005-05-01T09:23:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmayo86](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@jmayo86](https://forum.kirupa.com/u/jmayo86)\
**Post date:** [May 1, 2005, 9:23am UTC](https://forum.kirupa.com/t/mp3-player-problem/88643/1 "2005-05-01T09:23:57Z")

</div>

Hello all.  
I have built an MP3 player in flash (its only basic) and it plays the track automatically, then skips over to the next track once one has been played. But i want to make it so that when the track is being played, it displays the track name and artist in a text box/field, and it will update when the next track plays. Any ideas?

I have posted my code below:

[AS] // playlist  
var tracks = [“1.mp3”, “2.mp3”, “3.mp3”, “4.mp3”, “5.mp3”], i = 0;  
// define sound object  
track = new Sound();  
// load first track  
track.loadSound(tracks\*, true);  
// onSoundComplete loop track

track.onSoundComplete = function (){  
// this referes to track  
// if it reaches the end of array, skip to first  
if(i == (tracks.length-1)){  
i=0;  
}else {  
i++  
}  
trace("Playing "+tracks\*);  
this.loadSound(tracks\*, true);  
}  
// stop track  
stopBTN.onRelease = function() {  
track.stop();  
};  
// play track  
playBTN.onRelease = function() {  
track.loadSound(tracks\*, true);  
};  
// play next track  
nextBTN.onRelease = function() {  
i = Math.min(i+1, tracks.length-1);  
track.loadSound(tracks\*, true);  
};  
// play previous track  
prevBTN.onRelease = function() {  
i = Math.max(0, i-1);  
track.loadSound(tracks\*, true);  
};  
[/AS]
