Frame 1
TemplateMaxi.main(this);
Symbol 20480 MovieClip [__Packages.PlayerBasic] Frame 0
class PlayerBasic
{
var _template, _timer, _sound2, _sound, _firstPlay;
function PlayerBasic (pTemplate) {
_template = pTemplate;
_template.player = this;
_timer = _root.createEmptyMovieClip("timer_mc", _root.getNextHighestDepth());
_timer.onEnterFrame = _template.delegate(this, _timerEnterFrame);
_timer.transition = false;
_sound2 = null;
if (_root.byteslimit != undefined) {
_bytesLimit = Number(_root.byteslimit);
}
if (_root.autoplay == "1") {
_template.playRelease();
} else {
_template.stopRelease();
}
}
function getLoading() {
var _local2 = _sound.getBytesLoaded();
var _local3 = _sound.getBytesTotal();
var _local4 = Math.round((_local2 / _local3) * 100);
return({loaded:_local2, total:_local3, percent:_local4});
}
function getPosition() {
return(_sound.position);
}
function setPosition(pPosition) {
_position = pPosition;
_sound.start(Math.round(_position / 1000));
_sound.stop();
if (isPlaying) {
play();
}
}
function getDuration() {
return(_sound.duration);
}
function play() {
if (!_firstPlay) {
_position = 0;
_sound = new Sound();
_sound.loadSound(_root.mp3, true);
_firstPlay = true;
}
_sound.start(Math.round(_position / 1000));
isPlaying = true;
}
function pause() {
_position = _sound.position;
_sound.stop();
isPlaying = false;
}
function stop() {
_position = 0;
_sound.start(0);
_sound.stop();
isPlaying = false;
}
function _timerEnterFrame() {
if (_root.byteslimit != undefined) {
_bytesLimit = Number(_root.byteslimit);
}
if (_bytesLimit > 0) {
var _local2 = _sound.getBytesLoaded();
if ((!_timer.transition) && (_sound2 != null)) {
_sound = _sound2;
_sound2 = null;
}
if ((_local2 > _bytesLimit) && ((!_timer.transition) && (_sound2 == null))) {
_timer.transition = true;
_position = 0;
_sound2 = new Sound();
_sound2.loadSound((_root.mp3 + "?random=") + Math.round(Math.random() * 100000), true);
_sound2.setVolume(0);
_sound2.start(0);
}
if (_timer.transition && (_sound2.position > 200)) {
var _local3 = _sound.getVolume();
var _local4 = _sound2.getVolume();
_local3 = _local3 - 1;
_local4 = _local4 + 1;
_sound.setVolume(_local3);
_sound2.setVolume(_local4);
if (_local3 <= 0) {
_sound = null;
_timer.transition = false;
}
}
}
}
//ASSetPropFlags(_local1, null, 1);
var _bytesLimit = 0;
var isPlaying = false;
var _position = 0;
}
Symbol 20481 MovieClip [__Packages.PlayerDefault] Frame 0
#initclip
if (!PlayerDefault) {
//(_global.PlayerDefault = function (pTemplate) {
super(pTemplate);
if (_root.volume != undefined) {
this.setVolume(Number(_root.volume));
}
if (_root.loop == "1") {
this.loop = true;
}
}) extends PlayerBasic
var _local1 = (_global.PlayerDefault /* register */).prototype;
_local1._soundComplete = function () {
this.stop();
if (this.loop) {
this.play();
}
};
_local1.milli2time = function (milli) {
var _local3 = Math.floor(milli / (1000 * 60));
var _local4 = Math.floor(milli / 1000) % 60;
return((((_local3 < 10) ? ("0" + _local3) : (_local3)) + ":") + ((_local4 < 10) ? ("0" + _local4) : (_local4)));
};
_local1.getPositionTime = function () {
if (this._sound.position != undefined) {
return(this.milli2time(this._sound.position));
}
return(undefined);
};
_local1.getDurationTime = function () {
if (this._sound.duration != undefined) {
return(this.milli2time(this._sound.duration));
}
return(undefined);
};
_local1.getID3 = function () {
return(this._sound.id3);
};
_local1.setVolume = function (pVolume) {
this.volume = Number(pVolume);
this._sound.setVolume(this.volume);
};
_local1.getVolume = function () {
return(this.volume);
};
_local1.play = function () {
super.play();
this._sound.setVolume(this.volume);
this._sound.onSoundComplete = this._template.delegate(this, this._soundComplete);
};
ASSetPropFlags(_local1, null, 1);
_local1.loop = false;
_local1.volume = 100;
}
#endinitclip
Symbol 20482 MovieClip [__Packages.ATemplate] Frame 0
class ATemplate
{
var _shortcuts, player;
function ATemplate () {
_shortcuts = new Array();
_initKey();
}
function _initKey() {
var _local2 = new Object();
_local2.onKeyUp = delegate(this, function () {
if (this._shortcuts[Key.getCode()]) {
this._shortcuts[Key.getCode()]();
}
});
Key.addListener(_local2);
}
function _addShortcut(pKeyCode, pFunction) {
_shortcuts[pKeyCode] = pFunction;
}
function playRelease() {
player.play();
if (player.getLoading().percent != 100) {
startLoading();
}
}
function pauseRelease() {
player.pause();
}
function stopRelease() {
player.stop();
}
function startLoading() {
}
function delegate(pTarget, pFunc) {
var _local4 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2));
};
_local4.target = pTarget;
_local4.func = pFunc;
return(_local4);
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20483 MovieClip [__Packages.TemplateMaxi] Frame 0
#initclip
if (!TemplateMaxi) {
//(_global.TemplateMaxi = function (pConfig) {
super();
this._initVars(pConfig);
this._initBackground();
this._initPlayButton();
this._initPauseButton();
this._initStopButton();
this._initInfoButton();
this._initVolumeButton();
var _local4 = this.buttonWidth;
var _local5 = new Array();
if (this._showSlider) {
_local5.push(this.buttonWidth);
}
if (this._showStop) {
_local4 = _local4 + this.buttonWidth;
_local5.push(this.buttonWidth);
}
if (this._showInfo) {
_local4 = _local4 + this.buttonWidth;
_local5.push(this.buttonWidth);
}
if (this._showVolume) {
_local4 = _local4 + this.volumeWidth;
_local5.push(this.volumeWidth);
}
this._initSlider(_local4);
this._createSeparators(_local5);
this._initInfoPanel();
var _local6 = this.delegate(this, function () {
if (this.player.isPlaying) {
this.pauseRelease();
} else {
this.playRelease();
}
});
var _local7 = this.delegate(this, function () {
var _local2 = this._volume;
_local2 = _local2 - 10;
if (_local2 < 0) {
_local2 = 0;
}
this.setVolume(_local2);
});
var _local8 = this.delegate(this, function () {
var _local2 = this._volume;
_local2 = _local2 + 10;
if (_local2 > this._volumeMax) {
_local2 = this._volumeMax;
}
this.setVolume(_local2);
});
this._addShortcut(32, _local6);
this._addShortcut(80, _local6);
this._addShortcut(83, this.delegate(this, function () {
this.stopRelease();
}));
this._addShortcut(37, this.delegate(this, function () {
this.player.setPosition(this.player.getPosition() - 5000);
}));
this._addShortcut(39, this.delegate(this, function () {
this.player.setPosition(this.player.getPosition() + 5000);
}));
this._addShortcut(109, _local7);
this._addShortcut(189, _local7);
this._addShortcut(107, _local8);
this._addShortcut(187, _local8);
this._addShortcut(73, this.delegate(this, function () {
this.infoRelease();
}));
}) extends ATemplate
var _local1 = (_global.TemplateMaxi /* register */).prototype;
(_global.TemplateMaxi /* register */).main = function () {
if (_root.config != undefined) {
var _local2 = new LoadVars();
_local2.onData = function (data) {
if (data != undefined) {
data = data.split("\r\n").join(newline);
var _local3 = data.split(newline);
var _local4 = 0;
for ( ; _local4 < _local3.length ; _local4++) {
var _local5 = _local3[_local4].split("=");
if (_local5[0] != "") {
if (_root[_local5[0]] == undefined) {
_root[_local5[0]] = _local5[1];
}
}
}
}
_root.player = new TemplateMaxi();
var _local6 = new PlayerDefault(_root.player);
if (_root.autoload) {
_root.player.playRelease();
_root.player.stopRelease();
}
};
_local2.load(_root.config, _local2, "GET");
} else if (_root.configxml != undefined) {
var _local3 = new XML();
_local3.ignoreWhite = true;
_local3.onLoad = function (success) {
if (success) {
var _local3 = 0;
for ( ; _local3 < this.firstChild.childNodes.length ; _local3++) {
var _local4 = this.firstChild.childNodes[_local3].attributes.name;
var _local5 = this.firstChild.childNodes[_local3].attributes.value;
if (_local4 != "") {
if (_root[_local4] == undefined) {
_root[_local4] = _local5;
}
}
}
}
_root.player = new TemplateMaxi();
var _local6 = new PlayerDefault(_root.player);
if (_root.autoload) {
_root.player.playRelease();
_root.player.stopRelease();
}
};
_local3.load(_root.configxml);
} else {
_root.player = new TemplateMaxi();
var _local4 = new PlayerDefault(_root.player);
if (_root.autoload) {
_root.player.playRelease();
_root.player.stopRelease();
}
}
};
_local1._setVar = function (pVarName, pList, pType) {
var _local5 = 0;
for ( ; _local5 < pList.length ; _local5++) {
if (pList[_local5] != undefined) {
switch (pType) {
case "Number" :
this[pVarName] = _global.parseInt(pList[_local5], 10);
break;
case "Color" :
this[pVarName] = _global.parseInt(pList[_local5], 16);
break;
case "Boolean" :
this[pVarName] = (((pList[_local5] == "false") || (pList[_local5] == false)) ? false : true);
break;
default :
this[pVarName] = pList[_local5];
}
return(true);
}
}
return(false);
};
_local1._initVars = function (pConfig) {
if ((_root.width != undefined) || ((pConfig.width != undefined) || ((_root.height != undefined) || (pConfig.height != undefined)))) {
Stage.scaleMode = "noScale";
Stage.align = "TL";
}
this._setVar("_width", [_root.width, pConfig.width], "Number");
this._setVar("_height", [_root.height, pConfig.height], "Number");
this._setVar("_backgroundColor", [_root.bgcolor, pConfig.bgcolor], "Color");
this._setVar("_backgroundColor1", [_root.bgcolor1, pConfig.bgcolor1], "Color");
this._setVar("_backgroundColor2", [_root.bgcolor2, pConfig.bgcolor2], "Color");
this._setVar("_buttonColor", [_root.buttoncolor, pConfig.buttoncolor], "Color");
this._setVar("_buttonOverColor", [_root.buttonovercolor, pConfig.buttonovercolor], "Color");
this._setVar("_sliderColor1", [_root.slidercolor1, pConfig.slidercolor1], "Color");
this._setVar("_sliderColor2", [_root.slidercolor2, pConfig.slidercolor2], "Color");
this._setVar("_sliderOverColor", [_root.sliderovercolor, pConfig.sliderovercolor], "Color");
this._setVar("_textColor", [_root.textcolor, pConfig.textcolor], "Color");
this._setVar("_loadingColor", [_root.loadingcolor, pConfig.loadingcolor], "Color");
this._setVar("_showStop", [_root.showstop, pConfig.showstop], "Boolean");
this._setVar("_showInfo", [_root.showinfo, pConfig.showinfo], "Boolean");
this._setVar("_showVolume", [_root.showvolume, pConfig.showvolume], "Boolean");
this._setVar("_showSlider", [_root.showslider, pConfig.showslider], "Boolean");
this._setVar("_backgroundSkin", [_root.skin, pConfig.skin], "String");
this._setVar("_volume", [_root.volume, pConfig.volume], "Number");
this._setVar("buttonWidth", [_root.buttonwidth, pConfig.buttonwidth], "Number");
this._setVar("sliderWidth", [_root.sliderwidth, pConfig.sliderwidth], "Number");
this._setVar("sliderHeight", [_root.sliderheight, pConfig.sliderheight], "Number");
this._setVar("volumeWidth", [_root.volumewidth, pConfig.volumewidth], "Number");
this._setVar("volumeHeight", [_root.volumeheight, pConfig.volumeheight], "Number");
this._setVar("_showLoading", [_root.showloading, pConfig.showloading], "String");
};
_local1._initBackground = function () {
if (this._backgroundInstance == undefined) {
this._backgroundInstance = this._target.createEmptyMovieClip("background_mc", this._target.getNextHighestDepth());
}
if (this._backgroundColor != undefined) {
this._backgroundInstance.beginFill(this._backgroundColor);
this._backgroundInstance.lineTo(0, this._height);
this._backgroundInstance.lineTo(this._width, this._height);
this._backgroundInstance.lineTo(this._width, 0);
this._backgroundInstance.endFill();
}
if (this._backgroundSkin != undefined) {
var _local2 = this._backgroundInstance.createEmptyMovieClip("skin_mc", this._backgroundInstance.getNextHighestDepth());
_local2.loadMovie(this._backgroundSkin);
} else {
this._backgroundInstance.beginGradientFill("linear", [this._backgroundColor1, this._backgroundColor2], [100, 100], [0, 255], {matrixType:"box", x:0, y:0, w:this._width, h:this._height, r:Math.PI / 2});
this._backgroundInstance.moveTo(0, 5);
this._backgroundInstance.lineTo(0, this._height - 5);
this._backgroundInstance.curveTo(0, this._height, 5, this._height);
this._backgroundInstance.lineTo(this._width - 5, this._height);
this._backgroundInstance.curveTo(this._width, this._height, this._width, this._height - 5);
this._backgroundInstance.lineTo(this._width, 5);
this._backgroundInstance.curveTo(this._width, 0, this._width - 5, 0);
this._backgroundInstance.lineTo(5, 0);
this._backgroundInstance.curveTo(0, 0, 0, 5);
this._backgroundInstance.endFill();
}
};
_local1._createSeparators = function (pSizes) {
this._separatorsInstance = this._target.createEmptyMovieClip("separators_mc", this._target.getNextHighestDepth());
var _local3 = 0;
var _local4 = 0;
for ( ; _local4 < pSizes.length ; _local4++) {
_local3 = _local3 + pSizes[_local4];
this._separatorsInstance.beginFill(13421772, 50);
this._separatorsInstance.moveTo(_local3, 2);
this._separatorsInstance.lineTo(_local3, this._height - 2);
this._separatorsInstance.lineTo(_local3 + 1, this._height - 2);
this._separatorsInstance.lineTo(_local3 + 1, 2);
this._separatorsInstance.endFill();
this._separatorsInstance.beginFill(6710886, 50);
this._separatorsInstance.lineTo(_local3 - 1, 2);
this._separatorsInstance.lineTo(_local3 - 1, this._height - 2);
this._separatorsInstance.lineTo(_local3, this._height - 2);
this._separatorsInstance.endFill();
}
};
_local1._initButton = function (pTarget, pWidth) {
if (pWidth == undefined) {
pWidth = this.buttonWidth;
}
var _local4 = pTarget.createEmptyMovieClip("area_mc", pTarget.getNextHighestDepth());
var _local5 = pTarget.createEmptyMovieClip("icon_mc", pTarget.getNextHighestDepth());
_local4.beginFill(0, 0);
_local4.moveTo(2, 2);
_local4.lineTo(2, this._height - 4);
_local4.lineTo(pWidth - 4, this._height - 4);
_local4.lineTo(pWidth - 4, 2);
_local4.endFill();
_local4.tabEnabled = false;
_local4.parent = this;
_local4.color = new Color(_local5);
_local4.onRollOver = function () {
this.color.setRGB(this.parent._buttonOverColor);
};
_local4.onRollOut = (_local4.onDragOut = (_local4.onPress = function () {
this.color.setRGB(this.parent._buttonColor);
}));
};
_local1._enableButton = function (pButton, pStatus, pMask) {
pButton.area_mc.enabled = pStatus;
pButton._visible = !pMask;
if (!pStatus) {
pButton.icon_mc._alpha = 30;
} else {
pButton.icon_mc._alpha = 100;
}
};
_local1._initPlayButton = function () {
if (this._playButtonInstance == undefined) {
this._playButtonInstance = this._target.createEmptyMovieClip("play_btn", this._target.getNextHighestDepth());
this._initButton(this._playButtonInstance);
}
this._playButtonInstance.area_mc.onRelease = this.delegate(this, this.playRelease);
this._playButtonInstance.icon_mc.beginFill(this._buttonColor);
this._playButtonInstance.icon_mc.lineTo(0, 8);
this._playButtonInstance.icon_mc.lineTo(6, 4);
this._playButtonInstance.icon_mc.endFill();
this._playButtonInstance.icon_mc._y = (this._height / 2) - (this._playButtonInstance.icon_mc._height / 2);
this._playButtonInstance.icon_mc._x = (this.buttonWidth / 2) - (this._playButtonInstance.icon_mc._width / 2);
};
_local1._initPauseButton = function () {
if (this._pauseButtonInstance == undefined) {
this._pauseButtonInstance = this._target.createEmptyMovieClip("pause_btn", this._target.getNextHighestDepth());
this._initButton(this._pauseButtonInstance);
}
this._pauseButtonInstance.area_mc.onRelease = this.delegate(this, this.pauseRelease);
this._pauseButtonInstance.icon_mc.beginFill(this._buttonColor);
this._pauseButtonInstance.icon_mc.lineTo(0, 8);
this._pauseButtonInstance.icon_mc.lineTo(3, 8);
this._pauseButtonInstance.icon_mc.lineTo(3, 0);
this._pauseButtonInstance.icon_mc.endFill();
this._pauseButtonInstance.icon_mc.beginFill(this._buttonColor);
this._pauseButtonInstance.icon_mc.moveTo(5, 0);
this._pauseButtonInstance.icon_mc.lineTo(5, 8);
this._pauseButtonInstance.icon_mc.lineTo(8, 8);
this._pauseButtonInstance.icon_mc.lineTo(8, 0);
this._pauseButtonInstance.icon_mc.endFill();
this._pauseButtonInstance.icon_mc._y = (this._height / 2) - (this._pauseButtonInstance.icon_mc._height / 2);
this._pauseButtonInstance.icon_mc._x = (this.buttonWidth / 2) - (this._pauseButtonInstance.icon_mc._width / 2);
};
_local1._initStopButton = function () {
if (this._showStop) {
if (this._stopButtonInstance == undefined) {
this._stopButtonInstance = this._target.createEmptyMovieClip("stop_btn", this._target.getNextHighestDepth());
this._initButton(this._stopButtonInstance);
}
this._stopButtonInstance._x = this.buttonWidth;
this._stopButtonInstance.area_mc.onRelease = this.delegate(this, this.stopRelease);
this._stopButtonInstance.icon_mc.beginFill(this._buttonColor);
this._stopButtonInstance.icon_mc.lineTo(0, 8);
this._stopButtonInstance.icon_mc.lineTo(8, 8);
this._stopButtonInstance.icon_mc.lineTo(8, 0);
this._stopButtonInstance.icon_mc.endFill();
this._stopButtonInstance.icon_mc._y = (this._height / 2) - (this._stopButtonInstance.icon_mc._height / 2);
this._stopButtonInstance.icon_mc._x = (this.buttonWidth / 2) - (this._stopButtonInstance.icon_mc._width / 2);
}
};
_local1._initInfoButton = function () {
if (this._showInfo) {
if (this._infoButtonInstance == undefined) {
this._infoButtonInstance = this._target.createEmptyMovieClip("info_btn", this._target.getNextHighestDepth());
this._initButton(this._infoButtonInstance);
}
this._infoButtonInstance._x = (this._showStop ? (this.buttonWidth * 2) : (this.buttonWidth));
this._infoButtonInstance.area_mc.onRelease = this.delegate(this, this.infoRelease);
this._infoButtonInstance.icon_mc.lineStyle(2, this._buttonColor);
this._infoButtonInstance.icon_mc.moveTo(0, 2);
this._infoButtonInstance.icon_mc.curveTo(0, 0, 2, 0);
this._infoButtonInstance.icon_mc.curveTo(4, 0, 4, 2);
this._infoButtonInstance.icon_mc.curveTo(4, 3.5, 3, 4);
this._infoButtonInstance.icon_mc.curveTo(2, 5, 2, 6);
this._infoButtonInstance.icon_mc.moveTo(2, 8);
this._infoButtonInstance.icon_mc.lineTo(2, 9);
this._infoButtonInstance.icon_mc._y = ((this._height / 2) - (this._infoButtonInstance.icon_mc._height / 2)) + 2;
this._infoButtonInstance.icon_mc._x = ((this.buttonWidth / 2) - (this._infoButtonInstance.icon_mc._width / 2)) + 2;
}
};
_local1._initInfoPanel = function () {
if (this._showInfo) {
if (this._infoPanel == undefined) {
this._infoPanel = this._target.createEmptyMovieClip("infoPanel_mc", this._target.getNextHighestDepth());
this._infoPanel.parent = this;
}
this._infoPanel.beginGradientFill("linear", [this._backgroundColor1, this._backgroundColor2], [100, 100], [0, 255], {matrixType:"box", x:0, y:0, w:this._width, h:this._height, r:Math.PI / 2});
this._infoPanel.moveTo(0, 5);
this._infoPanel.lineTo(0, this._height - 5);
this._infoPanel.curveTo(0, this._height, 5, this._height);
this._infoPanel.lineTo(this._width - 5, this._height);
this._infoPanel.curveTo(this._width, this._height, this._width, this._height - 5);
this._infoPanel.lineTo(this._width, 5);
this._infoPanel.curveTo(this._width, 0, this._width - 5, 0);
this._infoPanel.lineTo(5, 0);
this._infoPanel.curveTo(0, 0, 0, 5);
this._infoPanel.endFill();
this._infoPanel.createTextField("time_txt", 1, 2, 0, 70, this._height);
this._infoPanel.createTextField("info_txt", 2, 72, 0, this._width - 74, this._height);
var _local2 = new TextFormat();
_local2.color = this._textColor;
_local2.font = "_sans";
_local2.align = "left";
this._infoPanel.time_txt.selectable = false;
this._infoPanel.time_txt.setNewTextFormat(_local2);
this._infoPanel.info_txt.selectable = false;
this._infoPanel.info_txt.setNewTextFormat(_local2);
this._infoPanel._visible = false;
this._infoPanel.onRelease = function () {
delete this.onEnterFrame;
this._visible = false;
};
this._infoPanel.waitScroll = (this._infoPanel.scrollMemo = 0);
this._infoPanel.update = function () {
var _local2 = "";
this._visible = true;
this.time_txt.text = "";
this.info_txt.text = "";
var _local3 = this.parent.player.getID3();
if (this.parent.player.getDurationTime() != undefined) {
this.time_txt.text = (this.parent.player.getPositionTime() + "/") + this.parent.player.getDurationTime();
} else {
this.time_txt.text = "Non charg\u00E9";
}
if (_local3.artist != undefined) {
this.info_txt.text = this.info_txt.text + (_local2 + _local3.artist);
_local2 = " - ";
}
if (_local3.songname != undefined) {
this.info_txt.text = this.info_txt.text + (_local2 + _local3.songname);
}
if (this.info_txt.text == "") {
this.info_txt.text = this.info_txt.text + "Inconnu";
}
if (this.info_txt.maxhscroll > 0) {
this.info_txt.text = this.info_txt.text + _local2;
var _local4 = this.info_txt.length;
this.info_txt.text = this.info_txt.text.substring(this.scrollMemo, _local4) + this.info_txt.text.substring(0, this.scrollMemo - 1);
if ((++this.waitScroll) > 5) {
this.scrollMemo = this.scrollMemo + 1;
this.waitScroll = 0;
}
this.scrollMemo = this.scrollMemo % _local4;
}
};
}
};
_local1._initVolumeButton = function () {
if (this._showVolume) {
this._volumeButtonInstance = this._target.createEmptyMovieClip("volume_btn", this._target.getNextHighestDepth());
this._initButton(this._volumeButtonInstance, this.volumeWidth);
this._volumeButtonInstance._x = this.buttonWidth;
if (this._showStop) {
this._volumeButtonInstance._x = this._volumeButtonInstance._x + this.buttonWidth;
}
if (this._showInfo) {
this._volumeButtonInstance._x = this._volumeButtonInstance._x + this.buttonWidth;
}
this._volumeButtonInstance.area_mc.onPress = this.delegate(this, this._volumePress);
this._volumeButtonInstance.area_mc.onRelease = this.delegate(this, this._volumeRelease);
this._volumeButtonInstance.area_mc.onReleaseOutside = this.delegate(this, this._volumeRelease);
var _local2 = this._volumeButtonInstance.icon_mc.createEmptyMovieClip("background_mc", 1);
_local2.beginFill(this._buttonColor, 25);
_local2.moveTo(0, this.volumeHeight);
_local2.lineTo(this.volumeWidth - 8, this.volumeHeight);
_local2.lineTo(this.volumeWidth - 8, 0);
_local2.endFill();
_local2._y = (this._height / 2) - (_local2._height / 2);
_local2._x = (this.volumeWidth / 2) - (_local2._width / 2);
this._updateVolume();
}
};
_local1._updateVolume = function () {
if (this._volumeButtonInstance.icon_mc.current_mc == undefined) {
var _local2 = this._volumeButtonInstance.icon_mc.createEmptyMovieClip("current_mc", 2);
} else {
var _local2 = this._volumeButtonInstance.icon_mc.current_mc;
}
_local2.clear();
if (this._volume > this._volumeMax) {
this._volume = this._volumeMax;
}
var _local3 = ((this.volumeWidth - 8) * this._volume) / this._volumeMax;
var _local4 = this._volume / this._volumeMax;
_local2.beginFill(this._buttonColor);
_local2.moveTo(0, this.volumeHeight);
_local2.lineTo(_local3, this.volumeHeight);
_local2.lineTo(_local3, this.volumeHeight - (this.volumeHeight * _local4));
_local2.endFill();
_local2._y = _local2._parent.background_mc._y;
_local2._x = _local2._parent.background_mc._x;
};
_local1._volumeEnterFrame = function () {
var _local2 = this._volumeButtonInstance.icon_mc.current_mc._xmouse;
var _local3 = this._volumeButtonInstance.icon_mc.background_mc._width;
if (_local2 < 0) {
_local2 = 0;
}
if (_local2 > _local3) {
_local2 = _local3;
}
var _local4 = (_local2 * this._volumeMax) / _local3;
this.setVolume(_local4);
};
_local1._volumePress = function () {
this._volumeButtonInstance.onEnterFrame = this.delegate(this, this._volumeEnterFrame);
};
_local1._volumeRelease = function () {
delete this._volumeButtonInstance.onEnterFrame;
};
_local1._initSlider = function (pMargin) {
if (this._showSlider) {
this._sliderInstance = this._target.createEmptyMovieClip("slider_mc", this._target.getNextHighestDepth());
var _local3 = pMargin;
_local3 = _local3 + 10;
this._sliderInstance._x = _local3;
this._sliderInstance.width = (this._width - _local3) - 10;
this._sliderInstance.barBg_mc.removeMovieClip();
var _local4 = this._sliderInstance.createEmptyMovieClip("barBg_mc", this._sliderInstance.getNextHighestDepth());
_local4.beginFill(13421772, 25);
_local4.lineTo(this._sliderInstance.width, 0);
_local4.lineTo(this._sliderInstance.width, 1);
_local4.lineTo(0, 1);
_local4.endFill();
_local4.beginFill(6710886, 25);
_local4.moveTo(0, 0);
_local4.lineTo(0, -1);
_local4.lineTo(this._sliderInstance.width, -1);
_local4.lineTo(this._sliderInstance.width, 0);
_local4.endFill();
_local4._y = this._height / 2;
this._loadingInstance = this._sliderInstance.createEmptyMovieClip("loading_mc", this._sliderInstance.getNextHighestDepth());
this._loadingInstance.beginFill(this._loadingColor, 75);
this._loadingInstance.moveTo(0, -1);
this._loadingInstance.lineTo(this._sliderInstance.width, -1);
this._loadingInstance.lineTo(this._sliderInstance.width, 1);
this._loadingInstance.lineTo(0, 1);
this._loadingInstance.endFill();
this._loadingInstance._y = this._height / 2;
this._loadingInstance._xscale = 0;
this._loadingInstance._visible = false;
var _local5 = this._sliderInstance.createEmptyMovieClip("bar_mc", this._sliderInstance.getNextHighestDepth());
_local5.parent = this;
_local5.margin = _local3;
_local5.width = this.sliderWidth;
_local5.barWidth = this._sliderInstance.width;
_local5.color = new Color(_local5);
_local5.tabEnabled = false;
_local5.onRollOver = function () {
this.color.setRGB(this.parent._sliderOverColor);
};
_local5.onRollOut = function () {
var _local2 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
this.color.setTransform(_local2);
};
_local5.onPress = function () {
this.startDrag(false, 0, this._y, this.barWidth - this.width, this._y);
delete this.parent._sliderInstance.onEnterFrame;
};
_local5.onRelease = (_local5.onReleaseOutside = function () {
this.stopDrag();
var _local2 = (this._x / (this.barWidth - this.width)) * this.parent.player.getDuration();
this.parent.player.setPosition(_local2);
if (this.parent.player.isPlaying) {
this.parent.playRelease();
}
});
_local5.beginGradientFill("linear", [this._sliderColor1, this._sliderColor2], [100, 100], [50, 150], {matrixType:"box", x:0, y:0, w:this.sliderWidth, h:this.sliderHeight, r:Math.PI / 2});
_local5.moveTo(0, 4);
_local5.lineTo(0, this.sliderHeight - 4);
_local5.curveTo(0, this.sliderHeight, 4, this.sliderHeight);
_local5.lineTo(this.sliderWidth - 4, this.sliderHeight);
_local5.curveTo(this.sliderWidth, this.sliderHeight, this.sliderWidth, this.sliderHeight - 4);
_local5.lineTo(this.sliderWidth, 4);
_local5.curveTo(this.sliderWidth, 0, this.sliderWidth - 4, 0);
_local5.lineTo(4, 0);
_local5.curveTo(0, 0, 0, 4);
_local5.endFill();
_local5._y = (this._height / 2) - (this.sliderHeight / 2);
}
};
_local1._loading = function () {
var _local2 = this.player.getLoading();
this._loadingInstance._xscale = ((_local2.percent >= 1) ? (_local2.percent) : 0);
if (_local2.percent == 100) {
if (this._showLoading != "always") {
this._loadingInstance._visible = false;
}
delete this._loadingInstance.onEnterFrame;
}
};
_local1._sliderEnterFrame = function () {
var _local2 = (this._sliderInstance.loading_mc._visible ? (this._sliderInstance.loading_mc._width) : (this._sliderInstance.width - this.sliderWidth));
var _local3 = Math.round((this.player.getPosition() / this.player.getDuration()) * _local2);
this._sliderInstance.bar_mc._x = _local3;
if ((!this.player.isPlaying) && (_local3 == _local2)) {
this.stopRelease();
}
};
_local1.playRelease = function () {
super.playRelease();
this._enableButton(this._playButtonInstance, false, true);
this._enableButton(this._pauseButtonInstance, true);
this._enableButton(this._stopButtonInstance, true);
this._sliderInstance.onEnterFrame = this.delegate(this, this._sliderEnterFrame);
};
_local1.pauseRelease = function () {
super.pauseRelease();
this._enableButton(this._pauseButtonInstance, false, true);
this._enableButton(this._playButtonInstance, true);
};
_local1.stopRelease = function () {
super.stopRelease();
this._enableButton(this._stopButtonInstance, false);
this._enableButton(this._pauseButtonInstance, false, true);
this._enableButton(this._playButtonInstance, true);
delete this._sliderInstance.onEnterFrame;
this._sliderInstance.bar_mc._x = 0;
};
_local1.infoRelease = function () {
if ((this._infoPanel._visible = !this._infoPanel._visible)) {
this._infoPanel.onEnterFrame = this._infoPanel.update;
} else {
delete this._infoPanel.onEnterFrame;
}
};
_local1.setVolume = function (pVolume) {
this._volume = pVolume;
this._updateVolume();
this.player.setVolume(pVolume);
};
_local1.startLoading = function () {
super.startLoading();
this._loadingInstance.onEnterFrame = this.delegate(this, this._loading);
if (this._showLoading != "never") {
this._loadingInstance._visible = true;
}
};
_local1.__set__jsPlay = function (n) {
this.playRelease();
return(this.__get__jsPlay());
};
_local1.__set__jsPause = function (n) {
this.pauseRelease();
return(this.__get__jsPause());
};
_local1.__set__jsStop = function (n) {
this.stopRelease();
return(this.__get__jsStop());
};
_local1.__set__jsVolume = function (n) {
this.setVolume(Number(n));
return(this.__get__jsVolume());
};
_local1.__set__jsUrl = function (n) {
this.player._firstPlay = false;
_root.mp3 = n;
return(this.__get__jsUrl());
};
_local1.addProperty("jsStop", function () {
}, _local1.__set__jsStop);
_local1.addProperty("jsVolume", function () {
}, _local1.__set__jsVolume);
_local1.addProperty("jsPause", function () {
}, _local1.__set__jsPause);
_local1.addProperty("jsUrl", function () {
}, _local1.__set__jsUrl);
_local1.addProperty("jsPlay", function () {
}, _local1.__set__jsPlay);
ASSetPropFlags(_local1, null, 1);
_local1._width = 200;
_local1._height = 20;
_local1._backgroundColor1 = 8158332 /* 0x7C7C7C */;
_local1._backgroundColor2 = 0;
_local1._buttonColor = 16777215 /* 0xFFFFFF */;
_local1._buttonOverColor = 16776960 /* 0xFFFF00 */;
_local1._sliderColor1 = 13421772 /* 0xCCCCCC */;
_local1._sliderColor2 = 8947848 /* 0x888888 */;
_local1._sliderOverColor = 15658496 /* 0xEEEE00 */;
_local1._textColor = 16777215 /* 0xFFFFFF */;
_local1._loadingColor = 16776960 /* 0xFFFF00 */;
_local1._showStop = false;
_local1._showInfo = false;
_local1._showVolume = false;
_local1._showSlider = true;
_local1._volume = 100;
_local1._volumeMax = 200;
_local1._showLoading = "autohide";
_local1.buttonWidth = 26;
_local1.volumeWidth = 30;
_local1.volumeHeight = 6;
_local1.sliderWidth = 20;
_local1.sliderHeight = 10;
_local1._target = _root;
}
#endinitclip