Hello. I’m working on an MP3 player and I’m experiencing the following problems: When I launch the player, it automatically plays the last song on my list (I would like it to start on the first song). Also, when a song completes - it does not automatically play the next song - it only wants to repeat the last song on the list over and over. I realize it’s a good last song, but this is kinda ridiculous.
Anyhow, I really am trying hard to figure this stuff out on my own - but I’ve been at this for days and the following code snipet is the closest I’ve come. Any help would be greatly appreciated: :beam:
function preloader () {
var tracks = , i = 0;
trace (tracks);
my_sound = new Sound();
my_sound.loadSound(tracks*, true);
///////////////////////////////////
var temp = this.createEmptyMovieClip("temp", 9999);
temp.onEnterFrame = function() {
var snd_loaded = my_sound.getBytesLoaded();
var snd_total = my_sound.getBytesTotal();
var getPercent = Math.round((snd_loaded/snd_total)*100);
loadBar._xscale = getPercent;
loadText.text = getPercent+" %";
////////////////////////////////////
my_sound.onSoundComplete = function() {
if(i == (tracks.length-1)){// if it reaches the end of array, skip to first
i=0;
}else {
i++
}
preloader ();
}
}
}