I’ve got a bunch of songs that I’m playing in a movie. All of the songs get created with the Sound Object first. I created an array to keep track of the songs. I want to use the array to trigger a next track and previous track button to go to the next or previous song in the array:
airplane = new Sound();
airplane.attachSound("airplane");
allthaticando = new Sound();
allthaticando.attachSound("allthaticando");
benearme = new Sound();
benearme.attachSound("benearme");
songs = new Array();
songs[0] = airplane;
songs[1] = allthaticando;
songs[2] = benearme;
nextSong = function () {
for (i=0; i<songs.length-1; i++) {
stopAllSounds();
i++;
}
};
prevSong = function () {
stopAllSounds();
songs*--;
songs*.stop();
};
nextTrack.onRelease = function() {
nextSong();
};
prevTrack.onRelease = function() {
prevSong();
};
Any ideas?