play
Version 1play - tells the Mp3Jukebox to play the current song
Description
void play ( songID:Number )play() takes the passed songID (song position in array from makePlaylist()) and begins streaming that mp3. It also sets up the title of the song in the title bar, the duration and tells the song to move to the next one in the list when it is finished with the current song.
Example:
If you know the list of songs you'll be playing (i.e. not a dynamic XML list) you can create your own text and buttons, assigning the play feature to each one, allowing the user to skip to a chosen song.
//Construct player and load playlist
var player:Mp3Jukebox = new Mp3Jukebox("playlist.xml");
//Play the first song in the array
playSongOne.onRelease = function()
{
player.play(0);
}
//Play the fifth song in the array
playSongFive.onRelease = function()
{
player.play(4);
}
var player:Mp3Jukebox = new Mp3Jukebox("playlist.xml");
//Play the first song in the array
playSongOne.onRelease = function()
{
player.play(0);
}
//Play the fifth song in the array
playSongFive.onRelease = function()
{
player.play(4);
}
See also: makePlaylist(), stop(), pause(), prevSong(), nextSong()