pause

Version 1
pause - halts playback or resumes halted point

Description

Number pause ( )

pause() is a dual-purpose function. If the song is currently playing it will halt playback and save the position in a private variable. If the song is already in a pause state, if pause() is triggered it will read the paused position and begin playback at that point.

Example:

If you are using the Mp3Jukebox as a background music player for your site but want to use sound in another area of the site, you can have a button call your new project and pause the current music so that it may be resumed when the user returns to the main site.
//Construct player and load playlist
var player:Mp3Jukebox = new Mp3Jukebox("playlist.xml");

//Open a new project and pause the Mp3Jukebox
openViewer.onRelease = function()
{
    openMovieViewer("someMovie");
    player.pause();
}

//Close the project and resume playback of the Mp3Jukebox
closeViewer.onRelease = function()
{
    closeMovieViewer("someMovie");
    player.pause();
}

See also: makePlaylist(), stop(), play(), prevSong(), nextSong()

Home

Public Functions