setSongVolume

Version 1
setSongVolume - Sets the volume level of the current song.

Description

void setSongVolume ( level:Number )

setSongVolume() accepts levels from 0-100. Anything higher or lower is automatically (by way of Flash's functionality) moved within those limits. The volume level is set and the volume slider is also moved into the appropriate position.

Example:

To make a mute button, you could simply create a button that checks for a mute boolean and sets the volume level appropriately.
//Construct player and load playlist
var player:Mp3Jukebox = new Mp3Jukebox("playlist.xml");


//To mute or not to mute? That is the question.
muteVolume.onRelease = function()
{
    if(this.isPaused)
    {
        this.isPaused = false;
        player.setSongVolume(100);
    }
    else
    {
        this.isPaused = true;
        player.setSongVolume(0);
    }
}

See also: pause(), stop()

Home

Public Functions