Hi Everyone,
I have 3 tracks as background music for my site. I’m using this script to play them and to fastforward.
mp3path = "http://2-cubed.net/v2/audio/";
music = ["track1.mp3", "track2.mp3", "track3.mp3"];
t = 0;
function loadTrack(t) {
song = new Sound(this);
song.loadSound(mp3path+music[t], 999);
}
nextBut.onRelease = function() {
t<music.length-1 ? t++ : t=0;
loadTrack(t);
};
loadTrack(t);
Now i’m wondering what would i have to do to automatically go to the next track when track 1 is done.
I was trying this code but i’m not sure if it works.
song.onSoundComplete = function(){//
// soundobject.start(secondsoffset,loops);
t<music.length-1 ? t++ : t=0;
loadTrack(t);
}