// use deploy/index.html to test
// see index.html source to edit songs (flashvars object)
// the instance name of the mp3 player is "Mp3Player_mc"
// SETUP PLAYER from flashvars
// set player width in pixels (at least 300 px)
Mp3Player_mc.width = Number(_level0["width"]);
// set autoLoad (Boolean value)
// if true, the mp3 file will begin loading automatically
// if false, the mp3 fille will begin loading when the play button is pressed
Mp3Player_mc.autoLoad = (_level0["autoLoad"] == "true");
// set autoPlay (Boolean value, true/false)
// if true, the mp3 file will start playing automatically when loaded, if autoLoad is also true
// if false, the mp3 file will start playing when the play button is pressed
Mp3Player_mc.autoPlay = (_level0["autoPlay"] == "true");
// set repeat (Boolean value, true/false)
// if true, after all mp3 files have played, it will start from the begining, or replay the song if only one mp3 file
Mp3Player_mc.repeat = (_level0["repeat"] == "true");
// set initial volume from flashvars (Number between 0 and 1, where 0.5 means 50%)
Mp3Player_mc.volume = Number(_level0["volume"]);
// SET FILE/FILES from flahsvars
var dat:Array = new Array();
var i:Number = 1;
while(_level0["song" + i + "url"]) {
var ob:Object = new Object();
ob.url = _level0["song" + i + "url"];
if (_level0["song" + i + "artist"]) ob.artist = _level0["song" + i + "artist"];
if (_level0["song" + i + "songname"]) ob.songname = _level0["song" + i + "songname"];
dat.push(ob);
i++;
}
Mp3Player_mc.setData(dat);