function initPreferences()
{
if (preferences.data.musicOn == undefined)
{
preferences.data.musicOn = true;
} // end if
changePreferenceMusicOn(preferences.data.musicOn);
} // End of the function
function changePreferenceMusicOn(val)
{
musicOn = val;
preferences.data.musicOn = val;
preferences.data.flush();
} // End of the function
function initPlayer()
{
initPreferences();
initSound();
resetPositionIndicator();
assignButtons();
if (musicOn == true)
{
playSong();
disableButton(play_mc);
enableButton(pause_mc);
enableButton(stop_mc);
}
else
{
stopSong();
enableButton(play_mc);
disableButton(stop_mc);
disableButton(pause_mc);
} // end if
} // End of the function
function initSound()
{
song = new Sound(_root);
} // End of the function
function loadSong()
{
song.loadSound(playlist[currentSong].url, true);
loadingIndicator_mc.onEnterFrame = function ()
{
var _l2 = song.getBytesLoaded();
var _l3 = playlist[currentSong].filesize;
loadingIndicator_mc.loadingBar_mc._width = Number(_l2 / _l3 * loadingBarWidth);
if (_l2 == _l3)
{
delete this[ "onEnterFrame "];
} // end if
};
} // End of the function
function playSong()
{
if (song.getBytesLoaded() > = 0)
{
loadSong();
} // end if