Frame 1
TemplateParams_Header_TITLE = "HannahTease";
TemplateParams_Header_DIRECTOR = "Director";
TemplateParams_Header_DESCRIPTION = "Movie beginning...\r\n";
TemplateParams_Tailer_DESCRIPTION = "Movie end...\r\n";
if (playerOpts2 != undefined) {
playerOpts2 = "scaleMode*stage*s||pauseAtFirstFrame*true*b||pauseAtLastFrame*false*b||playerAlign*bottom*s||playerOverMovie*false*b||playerAutoHide*false*b||hideDelay*5000*i||autoHideMouse*false*b||panelColor*undefined*e||bufferTime*5*i||sndMute*false*b||sndVolume*100*i||showReplay*false*b||textReplay*Replay*s||autoLoad*false*b||unloadOnStop*false*b||autoRewind*true*b||thumbNail*HannahTease_FirstFrame.jpg*s||showPlayer*true*b||keepAspect*false*b||minWidth*0*i||minHeight*0*i||noMuteBtn*true*b||noStopBtn*false*b||noProcBar*false*b||noVolumeBar*true*b||noTimeText*true*b||playBtnAlign*center*s||playerExt**s||fscEvent*false*b||frameStart*2*i||frameEnd*60*i||targetFPS*30*i||targetType*eflv*s||targetClip*this*e||totalWidth*700*i||totalHeight*557*i||" + playerOpts2;
} else {
playerOpts2 = "scaleMode*stage*s||pauseAtFirstFrame*true*b||pauseAtLastFrame*false*b||playerAlign*bottom*s||playerOverMovie*false*b||playerAutoHide*false*b||hideDelay*5000*i||autoHideMouse*false*b||panelColor*undefined*e||bufferTime*5*i||sndMute*false*b||sndVolume*100*i||showReplay*false*b||textReplay*Replay*s||autoLoad*false*b||unloadOnStop*false*b||autoRewind*true*b||thumbNail*HannahTease_FirstFrame.jpg*s||showPlayer*true*b||keepAspect*false*b||minWidth*0*i||minHeight*0*i||noMuteBtn*true*b||noStopBtn*false*b||noProcBar*false*b||noVolumeBar*true*b||noTimeText*true*b||playBtnAlign*center*s||playerExt**s||fscEvent*false*b||frameStart*2*i||frameEnd*60*i||targetFPS*30*i||targetType*eflv*s||targetClip*this*e||totalWidth*700*i||totalHeight*557*i||";
}
function CreateParamObject(opts) {
var param = new Object();
var s = opts;
var ss = s.split("||", 100);
var opt;
var i;
i = 0;
while (i < ss.length) {
opt = ss[i].split("*", 3);
if (opt.length != 3) {
} else if (opt[2] == "i") {
param[opt[0]] = int(opt[1]);
} else if (opt[2] == "s") {
param[opt[0]] = "" + opt[1];
} else if (opt[2] == "e") {
param[opt[0]] = eval (opt[1]);
} else if (opt[2] == "b") {
param[opt[0]] = opt[1] == "true";
} else if (opt[2] == "f") {
param[opt[0]] = Number(opt[1]);
} else if (opt[2] == "c") {
var rgb = opt[1].split(",", 3);
if (rgb.length != 3) {
} else {
var r = int(rgb[0]);
var g = int(rgb[1]);
var b = int(rgb[2]);
param[opt[0]] = ((r << 16) | (g << 8)) | b;
}
}
i++;
}
return(param);
}
var paramObj = CreateParamObject(playerOpts2);
function FillOnListener(obj) {
obj.arrListener = new Array();
obj.AddListener = function (l) {
var _local2 = 0;
_local2 = 0;
while (_local2 < this.arrListener.length) {
if (this.arrListener[_local2] == l) {
return(undefined);
}
_local2++;
}
this.arrListener[this.arrListener.length] = l;
};
obj.RemoveListener = function (l) {
var _local2 = 0;
_local2 = 0;
while (_local2 < this.arrListener.length) {
if (this.arrListener[_local2] == l) {
this.arrListener.splice(_local2, 1);
return(undefined);
}
_local2++;
}
};
obj.DispatchEvent = function (event_type, event_name, info) {
var _local2 = 0;
_local2 = 0;
while (_local2 < this.arrListener.length) {
if (this.arrListener[_local2].onEvent != undefined) {
this.arrListener[_local2].onEvent(this, event_type, event_name, info);
}
_local2++;
}
};
}
function CreateBaseCtrl(parent, skin_mc) {
var _local2 = new Object();
if (parent == undefined) {
_local2.parent_mc = undefined;
} else {
_local2.parent_mc = parent.skin_mc;
}
FillOnListener(_local2);
_local2.parent = parent;
_local2.skin_mc = skin_mc;
_local2.xachor = 0;
_local2.yachor = 0;
_local2.x = 0;
_local2.y = 0;
_local2.rx = 0;
_local2.ry = 0;
_local2.width = 0;
_local2.height = 0;
_local2.children = new Array();
_local2.enabled = true;
_local2.visible = true;
if (parent != undefined) {
parent.addControl(_local2);
}
_local2.UpdateControlPos = function () {
if (this.parent == undefined) {
this.rx = this.x;
this.ry = this.y;
if (this.onSizeChanged != undefined) {
this.onSizeChanged();
}
var _local2 = 0;
_local2 = 0;
while (_local2 < this.children.length) {
this.children[_local2].UpdateControlPos();
_local2++;
}
return(undefined);
}
if ((this.leftBand != undefined) || (this.rightBand != undefined)) {
this.xachor = 0;
if (this.leftBand != undefined) {
this.x = this.leftBand;
} else {
this.x = 0;
}
if (this.rightBand != undefined) {
this.width = (this.parent.width - this.rightBand) - this.x;
} else {
this.width = this.parent.width - this.x;
}
}
if ((this.topBand != undefined) || (this.bottomBand != undefined)) {
this.yachor = 0;
if (this.topBand != undefined) {
this.y = this.topBand;
} else {
this.y = 0;
}
if (this.bottomBand != undefined) {
this.height = (this.parent.height - this.bottomBand) - this.y;
} else {
this.height = this.parent.height - this.y;
}
}
if (this.xachor == 0) {
this.rx = this.x + this.parent.rx;
} else if (this.xachor == 1) {
this.rx = (this.parent.rx + this.parent.width) + this.x;
} else if (this.xachor == 2) {
this.rx = (this.parent.rx + this.x) + (this.parent.width / 2);
}
if (this.yachor == 0) {
this.ry = this.y + this.parent.ry;
} else if (this.yachor == 1) {
this.ry = (this.parent.height + this.y) + this.parent.ry;
} else if (this.yachor == 2) {
this.ry = (this.parent.ry + (this.parent.height / 2)) + this.y;
}
if (this.onSizeChanged != undefined) {
this.onSizeChanged();
}
var _local2 = 0;
_local2 = 0;
while (_local2 < this.children.length) {
this.children[_local2].UpdateControlPos();
_local2++;
}
};
_local2.SetAchor = function (xa, ya) {
if (((xa == 0) || (xa == 1)) || (xa == 2)) {
this.xachor = xa;
}
if (((ya == 0) || (ya == 1)) || (ya == 2)) {
this.yachor = ya;
}
this.UpdateControlPos();
};
_local2.SetPosition = function (x, y, w, h) {
this.x = x;
this.y = y;
this.width = w;
this.height = h;
this.UpdateControlPos();
};
_local2.SetBand = function (l, r, t, b) {
this.leftBand = l;
this.topBand = t;
this.rightBand = r;
this.bottomBand = b;
this.UpdateControlPos();
};
_local2.addControl = function (c) {
var _local2 = 0;
_local2 = 0;
while (_local2 < this.children.length) {
if (this.children[_local2] == c) {
return(undefined);
}
_local2++;
}
this.children[this.children.length] = c;
};
_local2.RemoveFromParent = function (c) {
if (this.parent == undefined) {
return(undefined);
}
var _local2;
_local2 = 0;
while (_local2 < this.parent.children.length) {
if (this.parent.children[_local2] == c) {
this.parent.children.splice(_local2, 1);
return(undefined);
}
_local2++;
}
};
_local2.SetVisible = function (bVisible) {
this.visible = bVisible;
if (this.onVisibleChanged != undefined) {
this.onVisibleChanged();
}
var _local2 = 0;
_local2 = 0;
while (_local2 < this.children.length) {
this.children[_local2].onVisibleChanged();
_local2++;
}
};
_local2.SetEnabled = function (bEnabled) {
this.enabled = bEnabled;
if (this.onEnabledChanged != undefined) {
this.onEnabledChanged();
}
var _local2 = 0;
_local2 = 0;
while (_local2 < this.children.length) {
this.children[_local2].onEnabledChanged();
_local2++;
}
};
_local2.CheckIfParentVisible = function () {
var _local2 = this;
while (_local2.parent != undefined) {
if (!_local2.parent.visible) {
return(false);
}
_local2 = _local2.parent;
}
return(true);
};
_local2.CheckIfParentEnabled = function () {
var _local2 = this;
while (_local2.parent != undefined) {
if (!_local2.parent.enabled) {
return(false);
}
_local2 = _local2.parent;
}
return(true);
};
_local2.Destroy = function () {
this.onDestroy();
var _local2 = 0;
_local2 = 0;
while (_local2 < this.children.length) {
this.children[_local2].Destroy();
_local2++;
}
RemoveFromParent(this);
};
return(_local2);
}
function CreateButton(parent, skin_mc, name) {
var _local2 = CreateBaseCtrl(parent, skin_mc);
_local2.ctrl_type = "Button";
_local2.ctrl_name = name;
_local2.skin_mc._x = 0;
_local2.skin_mc._y = 0;
skin_mc._xscale = 100;
skin_mc._yscale = 100;
skin_mc.button_mc._visible = false;
_local2.button_mc = skin_mc.button_mc.duplicateMovieClip("button_" + name, skin_mc.getNextHighestDepth());
_local2.button = _local2.button_mc.button;
_local2.button.externalObj = _local2;
_local2.button_mc._visible = true;
_local2.button.onPress = function () {
var _local2 = this.externalObj;
if ((!_local2.enabled) || (!_local2.CheckIfParentEnabled())) {
return(undefined);
}
if (_local2.onPress != undefined) {
_local2.onPress();
}
};
_local2.button.onRelease = function () {
var _local2 = this.externalObj;
if (_local2.onRelease != undefined) {
_local2.onRelease();
}
};
_local2.onDestroy = function () {
this.button_mc.removeMovieClip();
};
_local2.onSizeChanged = function () {
this.button_mc._x = this.rx;
this.button_mc._y = this.ry;
this.button_mc._width = this.width;
this.button_mc._height = this.height;
};
_local2.onVisibleChanged = function () {
if (this.visible && (this.CheckIfParentVisible())) {
this.button_mc._visible = true;
} else {
this.button_mc._visible = false;
}
};
_local2.onEnabledChanged = function () {
if (this.enabled && (this.CheckIfParentEnabled())) {
this.button_mc.enabled = true;
this.button_mc.button.enabled = true;
this.button_mc.button.useHandCursor = true;
} else {
this.button_mc.enabled = false;
this.button_mc.button.enabled = false;
this.button_mc.button.useHandCursor = false;
}
};
return(_local2);
}
function CreateDualButton(parent, skin_mc, name) {
var _local2 = CreateBaseCtrl(parent, skin_mc);
_local2.ctrl_type = "DualButton";
_local2.ctrl_name = name;
_local2.skin_mc._x = 0;
_local2.skin_mc._y = 0;
skin_mc._xscale = 100;
skin_mc._yscale = 100;
skin_mc.button_mc0._visible = false;
skin_mc.button_mc1._visible = false;
_local2.button_mc0 = skin_mc.button_mc0.duplicateMovieClip(("dualbutton" + name) + "0", skin_mc.getNextHighestDepth());
if (skin_mc.button_mc1 == undefined) {
_local2.button_mc1 = skin_mc.button_mc0.duplicateMovieClip(("dualbutton" + name) + "1", skin_mc.getNextHighestDepth());
} else {
_local2.button_mc1 = skin_mc.button_mc1.duplicateMovieClip(("dualbutton" + name) + "1", skin_mc.getNextHighestDepth());
}
_local2.button0 = _local2.button_mc0.button;
_local2.button1 = _local2.button_mc1.button;
_local2.button0.externalObj = _local2;
_local2.button1.externalObj = _local2;
_local2.button_mc0._visible = true;
_local2.button_mc1._visible = false;
_local2.state = "on";
_local2.button0.onPress = function () {
var _local2 = this.externalObj;
if ((!_local2.enabled) || (!_local2.CheckIfParentEnabled())) {
return(undefined);
}
if (_local2.state == "on") {
_local2.state = "off";
} else {
_local2.state = "on";
}
_local2.UpdateUI();
if (_local2.onPress != undefined) {
_local2.onPress();
}
};
_local2.button1.onPress = _local2.button0.onPress;
_local2.button0.onRelease = function () {
if ((!o.enabled) || (!o.CheckIfParentEnabled())) {
return(undefined);
}
var o = this.externalObj;
if (o.onRelease != undefined) {
o.onRelease();
}
};
_local2.button1.onRelease = _local2.button0.onRelease;
_local2.onSizeChanged = function () {
this.button_mc0._x = this.rx;
this.button_mc0._y = this.ry;
this.button_mc0._width = this.width;
this.button_mc0._height = this.height;
this.button_mc1._x = this.rx;
this.button_mc1._y = this.ry;
this.button_mc1._width = this.width;
this.button_mc1._height = this.height;
};
_local2.UpdateUI = function () {
if (this.visible && (this.CheckIfParentVisible())) {
if (this.state == "on") {
this.button_mc0._visible = true;
this.button_mc1._visible = false;
} else {
this.button_mc0._visible = false;
this.button_mc1._visible = true;
}
} else {
this.button_mc0._visible = false;
this.button_mc1._visible = false;
}
if (this.enabled && (this.CheckIfParentEnabled())) {
this.button_mc0.button.enabled = true;
this.button_mc1.button.enabled = true;
} else {
this.button_mc0.button.enabled = false;
this.button_mc1.button.enabled = false;
}
};
_local2.onEnabledChanged = function () {
this.UpdateUI();
};
_local2.onVisibleChanged = function () {
this.UpdateUI();
};
_local2.onDestroy = function () {
this.button_mc0.removeMovieClip();
this.button_mc1.removeMovieClip();
};
_local2.GetState = function () {
return(this.state);
};
_local2.SetState = function (s) {
if (this.state == s) {
return(undefined);
}
this.state = s;
this.UpdateUI();
};
return(_local2);
}
function CreatePanel(parent, skin_mc, name) {
var _local2 = CreateBaseCtrl(parent, skin_mc);
_local2.ctrl_type = "Panel";
_local2.ctrl_name = name;
skin_mc._x = 0;
skin_mc._y = 0;
skin_mc._xscale = 100;
skin_mc._yscale = 100;
skin_mc.panel_mc._visible = false;
_local2.panel_mc = skin_mc.panel_mc.duplicateMovieClip("panel_" + name, skin_mc.getNextHighestDepth());
_local2.align = 0;
_local2.panel_mc._visible = true;
_local2.panel_mc.externalObj = _local2;
_local2.onSizeChanged = function () {
if (this.align == 0) {
} else if (this.align == 1) {
this.xachor = 0;
this.yachor = 0;
this.x = 0;
this.y = 0;
this.width = this.parent.width;
} else if (this.align == 2) {
this.xachor = 0;
this.yachor = 0;
this.x = this.parent.width - this.width;
this.y = 0;
this.height = this.parent.height;
} else if (this.align == 3) {
this.xachor = 0;
this.yachor = 0;
this.x = 0;
this.y = this.parent.height - this.height;
this.width = this.parent.width;
} else if (this.align == 4) {
this.xachor = 0;
this.yachor = 0;
this.x = 0;
this.y = 0;
this.height = this.parent.height;
}
this.panel_mc._x = this.rx;
this.panel_mc._y = this.ry;
this.panel_mc._width = this.width;
this.panel_mc._height = this.height;
};
_local2.SetAlign = function (nAlign) {
this.align = nAlign;
UpdateControlPos();
};
_local2.onVisibleChanged = function () {
if (this.visible && (this.CheckIfParentVisible())) {
this.panel_mc._visible = true;
} else {
this.panel_mc._visible = false;
}
};
_local2.onEnabledChanged = function () {
if (this.enabled && (this.CheckIfParentEnabled())) {
this.panel_mc.enabled = true;
} else {
this.panel_mc.enabled = false;
}
};
_local2.SetOnPress = function (pfn) {
this.onPress = pfn;
if (pfn == undefined) {
this.panel_mc.onPress = undefined;
} else {
this.panel_mc.onPress = function () {
this.externalObj.onPress();
};
}
};
_local2.onDestroy = function () {
this.panel_mc.removeMovieClip();
};
return(_local2);
}
function CreateSpin(parent, skin_mc, name) {
var ctrl = CreateBaseCtrl(parent, skin_mc);
ctrl.ctrl_type = "Spin";
ctrl.ctrl_name = name;
skin_mc._x = 0;
skin_mc._y = 0;
skin_mc._xscale = 100;
skin_mc._yscale = 100;
ctrl.track = skin_mc.track.duplicateMovieClip("track_" + name, skin_mc.getNextHighestDepth());
if (skin_mc.right != undefined) {
ctrl.right = skin_mc.right.duplicateMovieClip("right_" + name, skin_mc.getNextHighestDepth());
}
if (skin_mc.load != undefined) {
ctrl.load = skin_mc.load.duplicateMovieClip("load_" + name, skin_mc.getNextHighestDepth());
}
if (ctrl.right != undefined) {
ctrl.right_mask = skin_mc.createEmptyMovieClip("right_mask_" + name, skin_mc.getNextHighestDepth());
ctrl.right_mask.beginFill(255);
ctrl.right_mask.lineStyle(0, 16711935, 100);
with (ctrl.right_mask) {
moveTo(0, 0);
lineTo(100, 0);
lineTo(100, 5);
lineTo(0, 5);
lineTo(0, 0);
}
ctrl.right_mask.endFill();
}
if (skin_mc.left != undefined) {
ctrl.left = skin_mc.left.duplicateMovieClip("left_" + name, skin_mc.getNextHighestDepth());
}
ctrl.thumb = skin_mc.thumb.duplicateMovieClip("thumb_" + name, skin_mc.getNextHighestDepth());
skin_mc.thumb._visible = false;
skin_mc.track._visible = false;
skin_mc.left._visible = false;
skin_mc.right._visible = false;
skin_mc.load._visible = false;
ctrl.left._visible = true;
ctrl.load._visible = true;
ctrl.right._visible = false;
ctrl.bShowLeft = true;
ctrl.bShowRight = false;
ctrl.thumb.button.externalObj = ctrl;
ctrl.track.externalObj = ctrl;
ctrl.Max = 10;
ctrl.Min = 0;
ctrl.Position = 0;
ctrl.LoadPercent = 0;
if (ctrl.right != undefined) {
ctrl.right.setMask(ctrl.right_mask);
}
ctrl.thumb._height = int(ctrl.thumb._height);
if ((ctrl.thumb._height % 2) != 0) {
ctrl.thumb._height++;
}
ctrl.thumb.button.onPress = function () {
var _local2 = this.externalObj;
if ((!_local2.enabled) || (!_local2.CheckIfParentEnabled())) {
return(undefined);
}
var _local4 = _local2.track._x;
var _local3 = (_local2.track._y + (_local2.track._height / 2)) - (_local2.thumb._height / 2);
if (_local2.onDragStart != undefined) {
_local2.onDragStart();
}
_local2.timerDrag = setInterval(_local2.onDragInternal, 20, _local2);
startDrag (_local2.thumb, false, _local4, _local3, (_local4 + _local2.track._width) - _local2.thumb._width, _local3);
};
ctrl.thumb.button.onRelease = function () {
var _local2 = this.externalObj;
stopDrag();
clearInterval(_local2.timerDrag);
if ((!_local2.enabled) || (!_local2.CheckIfParentEnabled())) {
return(undefined);
}
_local2.UpdateDrag(_local2.thumb._x, _local2.thumb._y);
if (_local2.onDragEnd != undefined) {
_local2.onDragEnd();
}
};
ctrl.thumb.button.onReleaseOutside = ctrl.thumb.button.onRelease;
ctrl.onDragInternal = function (obj) {
var _local2 = obj.Position;
obj.Position = ((obj.Max - obj.Min) * (obj.thumb._x - obj.track._x)) / (obj.track._width - obj.thumb._width);
obj.UpdateDrag(obj.thumb._x, obj.thumb._y);
if (_local2 != obj.Position) {
if (obj.onDrag != undefined) {
obj.onDrag();
}
}
if (!obj.thumb.button.enabled) {
obj.thumb.button.onRelease();
}
};
ctrl.track.onPress = function () {
var _local2 = this.externalObj;
var _local3 = _local2.Position;
_local2.Position = ((_local2.Max - _local2.Min) * ((_local2.track._xmouse * _local2.track._xscale) / 100)) / _local2.track._width;
if (_local3 != _local2.Position) {
if (_local2.onDrag != undefined) {
_local2.onDrag();
}
}
_local2.SetPos(_local2.Position);
};
ctrl.onSizeChanged = function () {
this.track._x = this.rx;
this.track._y = this.ry;
this.track._width = this.width;
this.track._height = this.height;
this.SetPos(this.Position);
};
ctrl.onEnabledChanged = function () {
if (this.enabled && (this.CheckIfParentEnabled())) {
this.thumb.button.enabled = true;
this.track.enabled = true;
} else {
this.thumb.button.enabled = false;
this.track.enabled = false;
}
};
ctrl.onVisibleChanged = function () {
if (this.visible && (this.CheckIfParentVisible())) {
this.thumb._visible = true;
this.track._visible = true;
this.left._visible = this.bShowLeft;
this.right._visible = this.bShowRight;
this.load._visible = true;
} else {
this.thumb._visible = false;
this.track._visible = false;
this.left._visible = false;
this.right._visible = false;
this.load._visible = false;
}
};
ctrl.onDestroy = function () {
clearInterval(this.timerDrag);
this.timerDrag = undefined;
this.thumb.removeMovieClip();
this.right_mask.removeMovieClip();
this.track.removeMovieClip();
this.left.removeMovieClip();
this.right.removeMovieClip();
this.load.removeMovieClip();
};
ctrl.SetPos = function (nPos) {
nPos = int(nPos);
if (nPos < this.Min) {
nPos = this.Min;
}
if (nPos > this.Max) {
nPos = this.Max;
}
var _local4 = this.track._x + (((nPos - this.Min) * (this.track._width - this.thumb._width)) / (this.Max - this.Min));
var _local3 = (this.track._y + (this.track._height / 2)) - (this.thumb._height / 2);
this.UpdateDrag(_local4, _local3);
this.Position = nPos;
};
ctrl.UpdateDrag = function (dx, dy) {
var _local2;
this.thumb._x = dx;
this.thumb._y = dy;
this.left._x = this.track._x;
this.left._y = this.track._y;
this.left._height = this.track._height;
_local2 = (this.thumb._x + (this.thumb._width / 2)) - this.track._x;
if (_local2 < 0) {
_local2 = 0;
}
this.left._width = _local2;
this.right_mask._x = this.thumb._x + (this.thumb._width / 2);
this.right_mask._y = this.track._y;
this.right_mask._height = this.track._height;
_local2 = this.track._width - ((this.thumb._x + (this.thumb._width / 2)) - this.track._x);
if (_local2 < 0) {
_local2 = 0;
}
this.right_mask._width = _local2;
this.right._x = this.thumb._x;
this.right._y = this.track._y;
this.right._height = this.track._height;
this.load._x = this.track._x;
this.load._y = this.track._y;
this.load._height = this.track._height;
this.load._width = this.LoadPercent * this.track._width;
};
ctrl.SetMaxMin = function (nMin, nMax) {
if (nMax <= nMin) {
return(undefined);
}
this.Min = nMin;
this.Max = nMax;
this.SetPos(this.Position);
};
ctrl.SetLoadPercent = function (p) {
this.LoadPercent = p;
this.UpdateDrag(this.thumb._x, this.thumb._y);
};
ctrl.ShowLeft = function (bVisible) {
this.bShowLeft = bVisible;
this.onVisibleChanged();
};
ctrl.ShowRight = function (bVisible) {
this.bShowRight = bVisible;
this.onVisibleChanged();
};
return(ctrl);
}
function CreateMovieClipList(mcs, fpss) {
var _local2 = new Object();
_local2.mcs = mcs;
_local2.fpss = fpss;
_local2.time_ranges = new Array();
_local2.duration = 0;
_local2.curMC = 0;
_local2.bInitOK = false;
_local2.onEnterFrame = function () {
var _local2 = this.externalObj;
if (!_local2.bInitOK) {
return(undefined);
}
if (this._currentframe == 1) {
if (_local2.curMC == 0) {
_local2.onPlayStart();
}
}
if (this._currentframe == this._totalframes) {
this.stop();
if (_local2.curMC == (_local2.mcs.length - 1)) {
this.bIsPlaying = false;
_local2.onPlayEnd();
} else {
this.onEnterFrame = undefined;
this._visible = false;
_local2.curMC++;
_local2.mcs[_local2.curMC].onEnterFrame = _local2.onEnterFrame;
_local2.mcs[_local2.curMC]._visible = true;
if (_local2.bIsPlaying) {
_local2.mcs[_local2.curMC].gotoAndPlay(1);
} else {
_local2.mcs[_local2.curMC].gotoAndStop(1);
}
}
}
};
var _local3;
_local3 = 0;
while (_local3 < mcs.length) {
mcs[_local3]._visible = false;
mcs[_local3].externalObj = _local2;
_local2.duration = _local2.duration + (mcs[_local3]._totalframes / fpss[_local3]);
_local2.time_ranges[_local3] = _local2.duration;
_local3++;
}
_local3 = 0;
while (_local3 < mcs.length) {
mcs[_local3].gotoAndStop(1);
mcs[_local3].onEnterFrame = undefined;
_local3++;
}
mcs[0].onEnterFrame = _local2.onEnterFrame;
_local2.bInitOK = true;
_local2.GetMCAt = function (t) {
var _local2;
_local2 = 0;
while (_local2 < this.time_ranges.length) {
if (t < this.time_ranges[_local2]) {
return(_local2);
}
_local2++;
}
return(undefined);
};
_local2.SetWH = function (w, h) {
var _local2;
_local2 = 0;
while (_local2 < this.mcs.length) {
this.mcs[_local2]._width = w;
this.mcs[_local2]._height = h;
_local2++;
}
};
_local2.SetXY = function (x, y) {
var _local2;
_local2 = 0;
while (_local2 < this.mcs.length) {
this.mcs[_local2]._x = x;
this.mcs[_local2]._y = y;
_local2++;
}
};
_local2.Play = function () {
this.bIsPlaying = true;
this.mcs[this.curMC].play();
};
_local2.Stop = function () {
this.bIsPlaying = false;
this.mcs[this.curMC].stop();
};
_local2.SetBufferTime = function (t) {
var _local2;
_local2 = 0;
while (_local2 < this.mcs.length) {
this.mcs[_local2]._soundbuftime = t;
_local2++;
}
};
_local2.Seek = function (t) {
var _local3 = this.GetMCAt(t);
if (_local3 == undefined) {
return(undefined);
}
this.mcs[this.curMC].stop();
this.mcs[this.curMC]._visible = false;
this.mcs[this.curMC].onEnterFrame = undefined;
this.curMC = _local3;
t = this.time_ranges[_local3] - t;
var _local2 = int(t * this.fpss[_local3]);
if (_local2 <= 0) {
_local2 = 0;
}
_local2 = this.mcs[this.curMC]._totalframes - _local2;
if (_local2 <= 0) {
_local2 = 1;
}
if (_local2 >= this.mcs[this.curMC]._totalframes) {
_local2 = this.mcs[this.curMC]._totalframes;
}
this.mcs[this.curMC].onEnterFrame = this.onEnterFrame;
this.mcs[this.curMC]._visible = true;
if (this.bIsPlaying) {
this.mcs[this.curMC].gotoAndPlay(_local2);
} else {
this.mcs[this.curMC].gotoAndStop(_local2);
}
};
_local2.GetTime = function () {
return(this.time_ranges[this.curMC] - ((this.mcs[this.curMC]._totalframes - this.mcs[this.curMC]._currentframe) / this.fpss[this.curMC]));
};
return(_local2);
}
function CreateSWFPlayback(mcs, fpss) {
var _local2 = new Object();
FillOnListener(_local2);
_local2.mcList = CreateMovieClipList(mcs, fpss);
_local2.duration = _local2.mcList.duration;
_local2.State = "stop";
_local2.mcList.externalObj = _local2;
_local2.Open = function () {
this.mcList.Stop();
this.mcList.Seek(0);
};
_local2.Play = function () {
this.mcList.Play();
this.State = "play";
if (this.tmrPlay != undefined) {
clearInterval(this.tmrPlay);
}
this.tmrPlay = setInterval(this.onTimerPlay, 100, this);
};
_local2.Pause = function () {
this.mcList.Stop();
this.State = "pause";
if (this.tmrPlay != undefined) {
clearInterval(this.tmrPlay);
this.tmrPlay = undefined;
}
};
_local2.Stop = function () {
this.mcList.Stop();
this.State = "stop";
if (this.tmrPlay != undefined) {
clearInterval(this.tmrPlay);
this.tmrPlay = undefined;
}
};
_local2.Seek = function (t) {
this.mcList.Seek(t);
};
_local2.GetState = function () {
return(this.State);
};
_local2.GetDuration = function () {
return(this.duration);
};
_local2.GetVideoWidth = function () {
return(1);
};
_local2.GetVideoHeight = function () {
return(1);
};
_local2.GetX = function () {
return(this.mcList.mcs[0]._x);
};
_local2.GetY = function () {
return(this.mcList.mcs[0]._y);
};
_local2.SetXY = function (x, y) {
this.mcList.SetXY(x, y);
};
_local2.GetWidth = function () {
return(this.mcList.mcs[0]._width);
};
_local2.GetHeight = function () {
return(this.mcList.mcs[0]._height);
};
_local2.SetWidth = function (w) {
this.mcList.SetWH(w, -1);
};
_local2.SetHeight = function (h) {
this.mcList.SetWH(-1, h);
};
_local2.GetTime = function () {
return(this.mcList.GetTime());
};
_local2.SetBufferTime = function (t) {
this.mcList.SetBufferTime(t);
};
_local2.GetPercentage = function () {
return(0);
};
_local2.onTimerPlay = function (obj) {
obj.DispatchEvent("SWFPB", "onPlaying", undefined);
};
_local2.mcList.onPlayStart = function () {
var _local2 = this.externalObj;
if (!_local2.bOnPlayStartSent) {
_local2.bOnPlayStartSent = true;
_local2.DispatchEvent("SWFPB", "onPlayStart", undefined);
}
};
_local2.mcList.onPlayEnd = function () {
var _local2 = this.externalObj;
if (_local2.State == "play") {
_local2.DispatchEvent("SWFPB", "onPlayEnd", undefined);
}
};
return(_local2);
}
function CreateEFLVPlayback(mc, fps, fstart, fend) {
var _local2 = new Object();
FillOnListener(_local2);
_local2.duration = ((fend - fstart) + 1) / fps;
_local2.State = "stop";
_local2.mc = mc;
_local2.mc.externalObj = _local2;
_local2.fstart = fstart;
_local2.fend = fend;
_local2.fps = fps;
_local2.bOnPlayStartSent = false;
_local2.Open = function () {
};
_local2.Close = function () {
this.Stop();
};
_local2.Play = function () {
this.mc.play();
this.State = "play";
if (this.tmrPlay != undefined) {
clearInterval(this.tmrPlay);
}
this.tmrPlay = setInterval(this.onTimerPlay, 100, this);
};
_local2.Pause = function () {
this.mc.stop();
this.State = "pause";
if (this.tmrPlay != undefined) {
clearInterval(this.tmrPlay);
this.tmrPlay = undefined;
}
};
_local2.Stop = function () {
this.mc.stop();
this.State = "stop";
if (this.tmrPlay != undefined) {
clearInterval(this.tmrPlay);
this.tmrPlay = undefined;
}
};
_local2.Seek = function (t) {
var _local2 = int((t * this.fps) + this.fstart);
if (_local2 < this.fstart) {
_local2 = this.fstart;
}
if (_local2 > this.fend) {
_local2 = this.fend;
}
if (this.State == "play") {
this.mc.gotoAndPlay(_local2);
} else {
this.mc.gotoAndStop(_local2);
}
};
_local2.GetState = function () {
return(this.State);
};
_local2.GetDuration = function () {
return(this.duration);
};
_local2.GetVideoWidth = function () {
return(1);
};
_local2.GetVideoHeight = function () {
return(1);
};
_local2.GetX = function () {
return(0);
};
_local2.GetY = function () {
return(0);
};
_local2.SetXY = function (x, y) {
};
_local2.GetWidth = function () {
return(1);
};
_local2.GetHeight = function () {
return(1);
};
_local2.SetWidth = function (w) {
};
_local2.SetHeight = function (h) {
};
_local2.GetTime = function () {
var _local2 = this.mc._currentframe - this.fstart;
if (_local2 < 0) {
_local2 = 0;
}
if (_local2 > ((this.fend - this.fstart) + 1)) {
_local2 = (this.fend - this.fstart) + 1;
}
return(_local2 / this.fps);
};
_local2.SetBufferTime = function (t) {
this.mc._soundbuftime = t;
};
_local2.GetPercentage = function () {
return((this.mc.getBytesLoaded() * 100) / this.mc.getBytesTotal());
};
_local2.onTimerPlay = function (obj) {
obj.DispatchEvent("EFLVPB", "onPlaying", undefined);
};
_local2.mc.onEnterFrame = function () {
var _local2 = this.externalObj;
if (this._currentframe == _local2.fstart) {
_local2.onPlayStart();
} else if (this._currentframe >= _local2.fend) {
_local2.onPlayEnd();
}
};
_local2.onPlayStart = function () {
if (!this.bOnPlayStartSent) {
this.bOnPlayStartSent = true;
this.DispatchEvent("EFLVPB", "onPlayStart", undefined);
}
};
_local2.onPlayEnd = function () {
if (this.State == "play") {
this.DispatchEvent("EFLVPB", "onPlayEnd", undefined);
}
};
return(_local2);
}
function CreateFLVPlayback(path, scr) {
var _local2 = new Object();
FillOnListener(_local2);
_local2.nc = new NetConnection();
_local2.nc.connect(null);
_local2.ns = new NetStream(_local2.nc);
_local2.ns.externalObj = _local2;
_local2.videoScr = scr;
_local2.width = undefined;
_local2.height = undefined;
_local2.duration = undefined;
_local2.path = path;
_local2.State = "stop";
_local2.Open = function () {
if ((this.videoScr != undefined) || (this.videoScr != null)) {
this.videoScr.attachVideo(this.ns);
}
this.bPlayed = true;
this.ns.play(this.path);
this.ns.pause(true);
};
_local2.Close = function () {
this.Stop();
this.ns.close();
this.videoScr.attachVideo(undefined);
};
_local2.SetDeblocking = function (nLevel) {
if (this.videoScr != undefined) {
this.videoScr.deblocking = nLevel;
}
};
_local2.SetSmoothing = function (bSmooth) {
if (this.videoScr != undefined) {
this.videoScr.smoothing = bSmooth;
}
};
_local2.Play = function () {
this.ns.pause(false);
if (this.tmrPlay != undefined) {
clearInterval(this.tmrPlay);
}
this.State = "play";
this.tmrPlay = setInterval(this.onTimerPlay, 100, this);
};
_local2.Pause = function () {
this.ns.pause(true);
if (this.tmrPlay != undefined) {
clearInterval(this.tmrPlay);
this.tmrPlay = undefined;
}
this.State = "pause";
};
_local2.Stop = function () {
this.Pause();
this.State = "stop";
};
_local2.Seek = function (t) {
this.ns.seek(t);
};
_local2.GetState = function () {
return(this.State);
};
_local2.GetDuration = function () {
return(this.duration);
};
_local2.GetVideoWidth = function () {
return(this.width);
};
_local2.SetWidth = function (w) {
if (this.videoScr != undefined) {
this.videoScr._width = w;
}
};
_local2.GetWidth = function () {
if (this.videoScr != undefined) {
return(this.videoScr._width);
}
};
_local2.GetHeight = function () {
if (this.videoScr != undefined) {
return(this.videoScr._height);
}
};
_local2.GetVideoHeight = function () {
return(this.height);
};
_local2.SetHeight = function (h) {
if (this.videoScr != undefined) {
this.videoScr._height = h;
}
};
_local2.GetX = function () {
return(this.videoScr._x);
};
_local2.GetY = function () {
return(this.videoScr._y);
};
_local2.SetXY = function (x, y) {
this.videoScr._x = x;
this.videoScr._y = y;
};
_local2.GetTime = function () {
return(this.ns.time);
};
_local2.SetBufferTime = function (t) {
this.ns.setBufferTime(t);
};
_local2.GetPercentage = function () {
if (this.ns.bytesTotal == 0) {
return(0);
}
return((this.ns.bytesLoaded * 100) / this.ns.bytesTotal);
};
_local2.onTimerPlay = function (obj) {
obj.DispatchEvent("FLVPB", "onPlaying", undefined);
};
_local2.ns.onMetaData = function (info) {
this.externalObj.duration = info.duration;
this.externalObj.width = info.width;
this.externalObj.height = info.height;
this.externalObj.DispatchEvent("FLVPB", "onMetaData", info);
};
_local2.ns.onCuePoint = function (info) {
this.externalObj.DispatchEvent("FLVPB", "onCuePoint", info);
};
_local2.ns.onStatus = function (stat) {
if (stat.code == "NetStream.Buffer.Empty") {
this.externalObj.DispatchEvent("FLVPB", "onBufferEmpty", undefined);
} else if (stat.code == "NetStream.Buffer.Full") {
this.externalObj.DispatchEvent("FLVPB", "onBufferFull", undefined);
} else if (stat.code == "NetStream.Play.Start") {
this.externalObj.DispatchEvent("FLVPB", "onPlayStart", undefined);
} else if (stat.code == "NetStream.Play.Stop") {
this.externalObj.Pause();
this.externalObj.DispatchEvent("FLVPB", "onPlayEnd", undefined);
} else if (stat.code == "NetStream.Play.StreamNotFound") {
this.externalObj.DispatchEvent("FLVPB", "onError", undefined);
}
};
return(_local2);
}
function ToText(v, n) {
var _local1 = "" + v;
while (length(_local1) < n) {
_local1 = "0" + _local1;
}
return(_local1);
}
function ToMinSec(t) {
t = int(t);
return((ToText(int(t / 60), 2) + ":") + ToText(t % 60, 2));
}
function CreateMoyeaPlayer(param) {
var player = new Object();
this._lockroot = true;
if (param.targetType == "swf") {
var _local21;
var _local19;
if (param.targetClip.length == undefined) {
_local21 = new Array();
_local21[0] = param.targetClip;
_local19 = new Array();
_local19[0] = param.targetFPS;
player.playback = CreateSWFPlayback(_local21, _local19);
} else {
player.playback = CreateSWFPlayback(param.targetClip, param.targetFPS);
}
} else if (param.targetType == "flv") {
player.playback = CreateFLVPlayback(param.targetClip, param.videoScr);
} else if (param.targetType == "eflv") {
player.playback = CreateEFLVPlayback(param.targetClip, param.targetFPS, param.frameStart, param.frameEnd);
} else {
trace("Not supported target type");
return(undefined);
}
player.skin_mc = param.skin_mc;
FillOnListener(player);
if (param.bufferTime != undefined) {
player.playback.SetBufferTime(param.bufferTime);
} else {
player.playback.SetBufferTime(5);
}
player.sndControler = new Sound();
if (param.sndVolume != undefined) {
player.sndVolume = param.sndVolume;
} else {
player.sndVolume = 100;
}
player.onPlayPausePress = function () {
var _local2 = this.thisPlayer;
var _local3 = _local2.playback.GetState();
if (!_local2.bIsOpen) {
_local2.bIsOpen = true;
_local2.playClicked = true;
_local2.playback.Open();
}
if (_local3 == "pause") {
_local2.playback.Play();
} else if (_local3 == "stop") {
if (_local2.playback.GetTime() != 0) {
_local2.playback.Seek(0);
}
_local2.playback.Play();
} else {
_local2.playback.Pause();
}
_local2.UpdateUI();
_local2.DispatchEvent("MoyeaPlayer", "onStateChanged", undefined);
_local2.DispatchEvent("MoyeaPlayer", "onPlayPausePress", undefined);
};
player.onReplayButonPress = function () {
var _local2 = this.thisPlayer;
_local2.playback.Seek(0);
_local2.playback.Play();
_local2.UpdateUI();
_local2.DispatchEvent("MoyeaPlayer", "onStateChanged", undefined);
_local2.DispatchEvent("MoyeaPlayer", "onReplayPress", undefined);
};
player.onStopPress = function () {
var _local2 = this.thisPlayer;
_local2.playback.Stop();
if (_local2.playback.GetTime() != 0) {
_local2.playback.Seek(0);
}
_local2.UpdateUI();
if (_local2.param.unloadOnStop) {
_local2.playback.Close();
_local2.bIsOpen = false;
}
_local2.DispatchEvent("MoyeaPlayer", "onStateChanged", undefined);
_local2.DispatchEvent("MoyeaPlayer", "onStopPress", undefined);
};
player.onDragStart = function () {
var _local2 = this.thisPlayer;
_local2.bDragging = true;
if (_local2.playback.GetState() != "pause") {
_local2.bNeedResume = true;
} else {
_local2.bNeedResume = false;
}
_local2.playback.Pause();
_local2.DispatchEvent("MoyeaPlayer", "onProcBarDragStart", undefined);
};
player.onDrag = function () {
var _local2 = this.thisPlayer;
_local2.playback.Seek(_local2.processBar.Position / 1000);
if (_local2.bDragging) {
_local2.playback.Pause();
}
_local2.DispatchEvent("MoyeaPlayer", "onProcBarDragging", undefined);
};
player.onDragEnd = function () {
var _local2 = this.thisPlayer;
_local2.bDragging = false;
_local2.playback.Seek(_local2.processBar.Position / 1000);
if (_local2.bNeedResume) {
_local2.playback.Play();
}
_local2.UpdateUI();
_local2.DispatchEvent("MoyeaPlayer", "onProcBarDragEnd", undefined);
};
player.onMutePress = function () {
var _local2 = this.thisPlayer;
_local2.SetMute(!_local2.GetMute());
_local2.DispatchEvent("MoyeaPlayer", "onMuteSwitch", undefined);
};
player.onVolumeDrag = function () {
var _local2 = this.thisPlayer;
_local2.sndVolume = _local2.volumeBar.Position;
if (!_local2.sndMute) {
_local2.sndControler.setVolume(_local2.sndVolume);
}
};
player.onLinkButonPress = function () {
getURL (this.linkURL, this.linkTarget);
};
player.UpdateUI = function () {
var _local2 = this.playback.GetState();
if (_local2 == "play") {
this.btnPlayPause.SetState("on");
this.btnStop.SetEnabled(true);
if (this.bSeekAble) {
this.processBar.SetEnabled(true);
this.processBar.SetPos(this.playback.GetTime() * 1000);
} else {
this.processBar.SetPos(0);
}
} else if (_local2 == "pause") {
this.btnPlayPause.SetState("off");
this.btnStop.SetEnabled(true);
if (this.bSeekAble) {
this.processBar.SetEnabled(true);
this.processBar.SetPos(this.playback.GetTime() * 1000);
} else {
this.processBar.SetPos(0);
}
} else if (_local2 == "stop") {
this.btnStop.SetEnabled(false);
this.btnPlayPause.SetState("off");
this.processBar.SetEnabled(false);
this.processBar.SetPos(0);
}
if (this.sndMute) {
this.btnMute.SetState("off");
} else {
this.btnMute.SetState("on");
}
if (_local2 != "stop") {
this.grayPanel.SetVisible(false);
this.btnReplay.SetVisible(false);
}
this.textTime.panel_mc.text.text = (ToMinSec(this.playback.GetTime()) + " / ") + ToMinSec(this.playback.GetDuration());
};
player.onEvent = function (sender, t, n, data) {
if (n == "onPlayStart") {
if ((this.param.onPlayURL != undefined) && (this.onPlayURLVarsMC == undefined)) {
this.onPlayURLVarsMC = _root.createEmptyMovieClip("", _root.getNextHighestDepth());
var _local4 = this.param.onPlayURL;
if (_local4.indexOf("?", 0) != -1) {
_local4 = _local4 + ("&movieID=" + this.param.movieID);
} else {
_local4 = _local4 + ("?movieID=" + this.param.movieID);
}
loadVariables (_local4, this.onPlayURLVarsMC);
}
if ((!this.playClicked) && (this.param.pauseAtFirstFrame)) {
this.playClicked = false;
this.playback.Stop();
} else {
this.playClicked = false;
this.playback.Play();
}
this.UpdateUI();
this.DispatchEvent("MoyeaPlayer", "onStateChanged", undefined);
this.DispatchEvent("MoyeaPlayer", n, data);
} else if (n == "onMetaData") {
if (sender.GetDuration() != undefined) {
this.processBar.SetMaxMin(0, sender.GetDuration() * 1000);
this.bSeekAble = true;
}
this.AdjustControls();
this.UpdateUI();
this.DispatchEvent("MoyeaPlayer", n, data);
} else if (n == "onPlaying") {
if (this.bDragging) {
return(undefined);
}
this.UpdateUI();
this.DispatchEvent("MoyeaPlayer", n, data);
} else if (n == "onPlayEnd") {
if (this.bDragging) {
return(undefined);
}
if ((this.param.urlOnEnd != undefined) && (this.param.urlOnEnd != "")) {
if (this.param.urlOnEndBrowser == "swf") {
_root.loadMovie(this.param.urlOnEnd);
} else if (this.param.urlOnEndBrowser == "flv") {
this.param.targetType = "flv";
this.playback.Stop();
this.playback.path = this.param.urlOnEnd;
this.playback.Open();
this.playback.Seek(0);
this.playback.Play();
} else {
getURL (this.param.urlOnEnd, this.param.urlOnEndTarget);
}
}
if (this.param.autoRewind) {
this.playback.Seek(0);
this.Play();
return(undefined);
}
if (!this.param.pauseAtLastFrame) {
this.playback.Seek(0);
}
this.playback.Stop();
this.UpdateUI();
if (this.param.showReplay) {
this.grayPanel.SetVisible(true);
this.btnReplay.SetVisible(true);
}
this.DispatchEvent("MoyeaPlayer", "onStateChanged", undefined);
} else if (n == "onBufferEmpty") {
if (player.GetState() != "stop") {
this.processBar.ShowRight(true);
}
this.DispatchEvent("MoyeaPlayer", n, data);
} else if (n == "onBufferFull") {
this.processBar.ShowRight(false);
this.DispatchEvent("MoyeaPlayer", n, data);
} else if (n == "onCuePoint") {
this.DispatchEvent("MoyeaPlayer", n, data);
}
};
player.onMouseMove = function () {
if (!this.playerPanel.visible) {
if ((this.ForceVisible == undefined) || (this.ForceVisible)) {
this.playerPanel.SetVisible(true);
if (this.param.autoHideMouse) {
Mouse.show();
}
this.AdjustControls();
}
}
clearInterval(this.timerHidePlayer);
this.timerHidePlayer = undefined;
this.timerHidePlayer = setInterval(this.onTimerHidePlayer, this.hideDelay, this);
};
player.CheckIfMouseInPlayer = function () {
if (this.ForceMouseOut) {
this.ForceMouseOut = false;
return(false);
}
if (this.param.playerAlign == "top") {
if ((((this.skin_mc._xmouse < (this.playerPanel.rx + 10)) || (this.skin_mc._xmouse > ((this.playerPanel.rx + this.playerPanel.width) - 10))) || (this.skin_mc._ymouse < (this.playerPanel.ry + 10))) || (this.skin_mc._ymouse > (this.playerPanel.ry + this.playerPanel.height))) {
return(false);
}
} else if ((((this.skin_mc._xmouse < (this.playerPanel.rx + 10)) || (this.skin_mc._xmouse > ((this.playerPanel.rx + this.playerPanel.width) - 10))) || (this.skin_mc._ymouse < this.playerPanel.ry)) || (this.skin_mc._ymouse > ((this.playerPanel.ry + this.playerPanel.height) - 10))) {
return(false);
}
return(true);
};
player.onTimerHidePlayer = function (o) {
if (!o.CheckIfMouseInPlayer()) {
if (o.param.autoHideMouse) {
Mouse.hide();
}
o.playerPanel.SetVisible(false);
o.AdjustControls();
clearInterval(o.timerHidePlayer);
o.timerHidePlayer = undefined;
}
};
player.onLoadPercentChanged = function (o) {
o.processBar.SetLoadPercent(o.playback.GetPercentage() / 100);
};
player.tmrLoadPercent = setInterval(player.onLoadPercentChanged, 100, player);
player.Destroy = function () {
clearInterval(this.timerHidePlayer);
clearInterval(player.tmrLoadPercent);
Stage.removeListener(this);
Mouse.removeListener(this);
this.root_ctrl.Destroy();
this.playback.Close();
this.skin_mc.removeMovieClip();
};
var root_ctrl = CreateBaseCtrl(undefined, this);
root_ctrl.width = param.totalWidth;
root_ctrl.height = param.totalHeight;
player.root_ctrl = root_ctrl;
var _local22 = false;
if (param.targetType == "eflv") {
param.scaleMode = undefined;
}
if ((param.scaleMode == "no") || (param.scaleMode == "stage")) {
if (param.scaleMode == "stage") {
Stage.align = "TL";
}
Stage.scaleMode = "noScale";
Stage.addListener(player);
if (param.scaleMode == "no") {
root_ctrl.SetPosition(0, 0, param.totalWidth, param.totalHeight);
} else {
param.totalWidth = Stage.width;
param.totalHeight = Stage.height;
root_ctrl.SetPosition(0, 0, Stage.width, Stage.height);
}
_local22 = true;
} else {
root_ctrl.SetPosition(0, 0, param.totalWidth, param.totalHeight);
}
player.playerOverMovie = param.playerOverMovie;
player.scaleMode = param.scaleMode;
player.videoScr = param.videoScr;
player.playerHeight = param.playerHeight;
player.totalWidth = param.totalWidth;
player.totalHeight = param.totalHeight;
player.hideDelay = param.hideDelay;
if (player.hideDelay == undefined) {
player.hideDelay = 1000;
}
player.param = param;
player.videoRect = new Object();
player.screenRect = new Object();
player.videoLoaded = false;
player.AdjustControls = function () {
this.screenRect.x = 0;
this.screenRect.y = 0;
this.screenRect.w = this.totalWidth;
this.screenRect.h = this.totalHeight;
var _local9;
var _local8;
var _local3;
var _local2;
var _local7;
var _local6;
var _local4;
var _local5;
if (this.param.playerOverMovie || (!this.playerPanel.visible)) {
_local4 = this.totalWidth;
_local5 = this.totalHeight;
} else {
_local4 = this.totalWidth;
_local5 = this.totalHeight - this.playerHeight;
}
if (this.param.playerAlign == "top") {
_local7 = 0;
if (this.param.playerOverMovie || (!this.playerPanel.visible)) {
_local6 = 0;
} else {
_local6 = this.playerHeight;
}
} else {
_local7 = 0;
_local6 = 0;
}
_local9 = _local7;
_local8 = _local6;
if (this.param.keepAspect) {
_local3 = this.playback.GetVideoWidth();
_local2 = this.playback.GetVideoHeight();
if ((_local3 != undefined) && (_local2 != undefined)) {
if ((_local3 * _local5) > (_local2 * _local4)) {
_local2 = (_local2 * _local4) / _local3;
_local3 = _local4;
} else {
_local3 = (_local3 * _local5) / _local2;
_local2 = _local5;
}
_local9 = _local7 + ((_local4 - _local3) / 2);
_local8 = _local6 + ((_local5 - _local2) / 2);
} else {
_local3 = _local4;
_local2 = _local5;
}
} else {
_local3 = _local4;
_local2 = _local5;
}
this.playback.SetXY(_local9, _local8);
this.playback.SetWidth(_local3);
this.playback.SetHeight(_local2);
this.videoRect.x = _local9;
this.videoRect.y = _local8;
this.videoRect.w = _local3;
this.videoRect.h = _local2;
this.DispatchEvent("MoyeaPlayer", "onResize", this.videoRect);
};
player.onResize = function () {
if ((this.scaleMode == "stage") || (this.scaleMode == "no")) {
if (this.scaleMode == "stage") {
this.totalWidth = Stage.width;
this.totalHeight = Stage.height;
}
if (this.param.minWidth != undefined) {
if (this.param.minWidth > this.totalWidth) {
this.totalWidth = this.param.minWidth;
}
}
if (this.param.minHeight != undefined) {
if (this.param.minHeight > this.totalHeight) {
this.totalHeight = this.param.minHeight;
}
}
this.root_ctrl.SetPosition(0, 0, this.totalWidth, this.totalHeight);
this.screenRect.w = this.totalWidth;
this.screenRect.h = this.totalHeight;
this.AdjustControls();
}
};
player.Play = function () {
if (!this.bIsOpen) {
this.playClicked = true;
this.bIsOpen = true;
this.playback.Open();
}
if (this.playback.GetState() == "stop") {
if (this.playback.GetTime() != 0) {
this.playback.Seek(0);
}
}
this.playback.Play();
this.UpdateUI();
this.DispatchEvent("MoyeaPlayer", "onStateChanged", undefined);
};
player.Seek = function (t) {
if (!this.bIsOpen) {
this.bIsOpen = true;
this.playback.Open();
}
this.playback.Seek(t);
this.UpdateUI();
};
player.Pause = function () {
if (!this.bIsOpen) {
this.bIsOpen = true;
this.playback.Open();
}
this.playback.Pause();
this.UpdateUI();
this.DispatchEvent("MoyeaPlayer", "onStateChanged", undefined);
};
player.Stop = function () {
if (!this.bIsOpen) {
this.bIsOpen = true;
this.playback.Open();
}
if (this.playback.GetTime() != 0) {
this.playback.Seek(0);
}
this.playback.Stop();
this.UpdateUI();
if (this.param.unloadOnStop) {
this.playback.Close();
this.bIsOpen = false;
}
this.DispatchEvent("MoyeaPlayer", "onStateChanged", undefined);
};
player.SetMute = function (b) {
this.sndMute = b;
if (b) {
this.sndControler.setVolume(0);
} else {
this.sndControler.setVolume(this.sndVolume);
}
this.UpdateUI();
};
player.sndMute = false;
player.GetMute = function () {
return(this.sndMute);
};
player.SetVolume = function (v) {
this.sndVolume = v;
if (!this.sndMute) {
this.sndControler.setVolume(this.sndVolume);
}
this.volumeBar.SetPos(this.sndVolume);
};
player.GetVolume = function () {
return(this.sndVolume);
};
player.GetState = function () {
return(this.playback.GetState());
};
player.GetTime = function () {
return(this.playback.GetTime());
};
player.GetDuration = function () {
return(this.playback.GetDuration());
};
player.SetDebloking = function (l) {
this.playback.SetDeblocking(l);
};
player.SetSmoothing = function (b) {
this.playback.SetSmoothing(b);
};
player.SetVisible = function (b) {
this.ForceVisible = b;
this.playerPanel.SetVisible(b);
this.AdjustControls();
};
player.GetVisible = function () {
return(this.playerPanel.visible);
};
player.SetEnabled = function (b) {
this.playerPanel.SetEnabled(b);
};
player.GetEnabled = function () {
return(this.playerPanel.enabled);
};
player.SetColor = function (c) {
var _local2;
if (c == undefined) {
_local2 = 0;
while (_local2 < this.colorPanels.length) {
this.colorPanels[_local2].SetVisible(false);
_local2++;
}
} else {
var _local3;
_local2 = 0;
while (_local2 < this.colorPanels.length) {
_local3 = new Color(this.colorPanels[_local2].panel_mc);
_local3.setRGB(c);
this.colorPanels[_local2].SetVisible(true);
_local2++;
}
}
};
player.SetDepth = function (d) {
this.skin_mc.swapDepths(d);
};
player.colorPanels = new Array();
player.AddColorPanel = function (p) {
this.colorPanels[this.colorPanels.length] = p;
};
var _local7 = new Object();
_local7.root_ctrl = root_ctrl;
var _local6 = 0;
var _local3;
var _local5;
var _local4;
_local6 = 0;
for ( ; _local6 < param.elements.length ; _local6++) {
_local3 = param.elements[_local6];
if (_local3.parent == undefined) {
_local5 = root_ctrl;
} else {
_local5 = _local7[_local3.parent];
}
if (_local3.ctrlType == "playbtn") {
_local4 = CreateDualButton(_local5, player.skin_mc[_local3.ctrlName], _local3.ctrlName);
_local4.onPress = player.onPlayPausePress;
player.btnPlayPause = _local4;
_local4.SetState("off");
} else if (_local3.ctrlType == "stopbtn") {
_local4 = CreateButton(_local5, player.skin_mc[_local3.ctrlName], _local3.ctrlName);
_local4.onPress = player.onStopPress;
player.btnStop = _local4;
} else if (_local3.ctrlType == "mutebtn") {
_local4 = CreateDualButton(_local5, player.skin_mc[_local3.ctrlName], _local3.ctrlName);
_local4.onPress = player.onMutePress;
player.btnMute = _local4;
} else if (_local3.ctrlType == "procbar") {
_local4 = CreateSpin(_local5, player.skin_mc[_local3.ctrlName], _local3.ctrlName);
_local4.onDrag = player.onDrag;
_local4.onDragEnd = player.onDragEnd;
_local4.onDragStart = player.onDragStart;
player.processBar = _local4;
} else if (_local3.ctrlType == "volbar") {
_local4 = CreateSpin(_local5, player.skin_mc[_local3.ctrlName], _local3.ctrlName);
_local4.onDrag = player.onVolumeDrag;
_local4.onDragEnd = player.onVolumeDrag;
player.volumeBar = _local4;
} else if (_local3.ctrlType == "player_panel") {
_local4 = CreatePanel(_local5, player.skin_mc[_local3.ctrlName], _local3.ctrlName);
player.playerPanel = _local4;
} else if (_local3.ctrlType == "panel") {
_local4 = CreatePanel(_local5, player.skin_mc[_local3.ctrlName], _local3.ctrlName);
} else if (_local3.ctrlType == "color_panel") {
_local4 = CreatePanel(_local5, player.skin_mc[_local3.ctrlName], _local3.ctrlName);
player.AddColorPanel(_local4);
} else if (_local3.ctrlType == "link") {
_local4 = CreateButton(_local5, player.skin_mc[_local3.ctrlName], _local3.ctrlName);
_local4.linkURL = _local3.linkURL;
_local4.linkTarget = _local3.linkTarget;
_local4.onPress = player.onLinkButonPress;
} else if (_local3.ctrlType == "gray_panel") {
_local4 = CreatePanel(_local5, player.skin_mc[_local3.ctrlName], _local3.ctrlName);
_local4.SetVisible(false);
player.grayPanel = _local4;
} else if (_local3.ctrlType == "video_link") {
_local4 = CreatePanel(_local5, player.skin_mc[_local3.ctrlName], _local3.ctrlName);
_local4.SetVisible(false);
_local4.linkURL = param.videoLink;
_local4.linkTarget = param.videoLinkTarget;
_local4.SetOnPress(player.onLinkButonPress);
player.videoLinkPanel = _local4;
} else if (_local3.ctrlType == "replay_panel") {
_local4 = CreatePanel(_local5, player.skin_mc[_local3.ctrlName], _local3.ctrlName);
_local4.SetVisible(false);
_local4.SetOnPress(player.onReplayButonPress);
player.btnReplay = _local4;
if (param.textReplay == undefined) {
_local4.panel_mc.text.text = "Replay";
} else {
_local4.panel_mc.text.text = param.textReplay;
}
} else if (_local3.ctrlType == "time_panel") {
_local4 = CreatePanel(_local5, player.skin_mc[_local3.ctrlName], _local3.ctrlName);
player.textTime = _local4;
} else {
continue;
}
_local4.thisPlayer = player;
_local7[_local3.ctrlName] = _local4;
_local4.SetAchor(_local3.xachor, _local3.yachor);
_local4.SetPosition(_local3.x, _local3.y, _local3.width, _local3.height);
_local4.SetBand(_local3.leftBand, _local3.rightBand, _local3.topBand, _local3.bottomBand);
}
if (param.deblocking) {
player.playback.SetDeblocking(2);
} else {
player.playback.SetDeblocking(0);
}
if (param.deblocking == undefined) {
player.playback.SetDeblocking(2);
}
if (param.smoothing) {
player.playback.SetSmoothing(true);
} else {
player.playback.SetSmoothing(false);
}
if (param.smoothing == undefined) {
player.playback.SetSmoothing(true);
}
player.AdjustControls();
if (_local22) {
player.onResize();
}
if (param.playerAutoHide) {
Mouse.addListener(player);
player.ForceMouseOut = true;
player.onMouseMove();
}
player.grayPanel.SetBand(0, 0, 0, 0);
if (player.param.playerAlign == "top") {
player.playerPanel.SetAchor(0, 0);
player.playerPanel.SetPosition(0, 0, 10, player.playerHeight);
player.videoLinkPanel.SetBand(0, 0, player.playerHeight, 0);
} else {
player.playerPanel.SetAchor(0, 1);
player.playerPanel.SetPosition(0, -player.playerHeight, 10, player.playerHeight);
player.videoLinkPanel.SetBand(0, 0, 0, player.playerHeight);
}
player.playerPanel.SetBand(0, undefined, undefined, undefined);
player.SetColor(param.panelColor);
if (player.param.targetType == "flv") {
player.processBar.SetEnabled(false);
} else if ((player.param.targetType == "swf") || (player.param.targetType == "eflv")) {
player.processBar.SetEnabled(false);
player.bSeekAble = true;
}
player.volumeBar.SetMaxMin(0, 100);
player.volumeBar.SetPos(player.sndVolume);
player.sndMute = param.sndMute;
if (player.sndMute) {
player.btnMute.SetState("off");
player.sndControler.setVolume(0);
} else {
player.btnMute.SetState("on");
player.sndControler.setVolume(player.sndVolume);
}
player.playback.AddListener(player);
if (param.videoLink != undefined) {
player.videoLinkPanel.SetVisible(true);
}
player.processBar.SetMaxMin(0, player.playback.GetDuration() * 1000);
if (player.param.pauseAtFirstFrame == undefined) {
player.param.pauseAtFirstFrame = true;
}
param.skin_mc._visible = false;
player.skin_mc._visible = true;
if (param.autoLoad) {
player.bIsOpen = true;
player.playback.Open();
}
if (param.targetType == "flv") {
player.playback.Seek(0);
}
if (param.fscEvent) {
var _local20 = new Object();
_local20.onEvent = function (sender, t, n, data) {
fscommand (t, n);
};
player.AddListener(_local20);
}
if ((param.showPlayer != undefined) && (!param.showPlayer)) {
player.SetVisible(false);
}
return(player);
}
function FillDefaultParam(o) {
if (o.targetType == undefined) {
o.targetType = "flv";
}
if (o.skin_mc == undefined) {
o.skin_mc = skin_mc;
}
if (o.totalWidth == undefined) {
o.totalWidth = Stage.width;
}
if (o.totalHeight == undefined) {
o.totalHeight = Stage.height;
}
if (o.videoScr == undefined) {
o.videoScr = myScr;
}
if (o.scaleMode == undefined) {
o.scaleMode = "stage";
}
}
skin_mc._x = 0;
skin_mc._y = 0;
skin_mc._visible = false;
paramObj.playerHeight = 27;
var hUsage = 40;
var hUsage2 = -23;
var ctrls = new Array();
ctrls[0] = {ctrlType:"player_panel", ctrlName:"panel_mc", xachor:0, yachor:1, x:0, y:-27, width:0, height:27, leftBand:0};
ctrls[1] = {ctrlType:"playbtn", ctrlName:"play_mc", xachor:0, yachor:0, x:12, y:4, width:20, height:20, parent:"panel_mc"};
if (paramObj.noStopBtn) {
skin_mc.stop_mc._visible = false;
} else {
ctrls[2] = {ctrlType:"stopbtn", ctrlName:"stop_mc", xachor:0, yachor:0, x:hUsage, y:4, width:20, height:20, parent:"panel_mc"};
hUsage = hUsage + 30;
}
if (paramObj.noVolumeBar) {
skin_mc.volume_mc._visible = false;
} else {
ctrls[5] = {ctrlType:"volbar", ctrlName:"volume_mc", xachor:1, yachor:0, x:hUsage2 - 40, y:13, width:40, height:1, parent:"panel_mc"};
hUsage2 = hUsage2 + -44;
}
if (paramObj.noMuteBtn) {
skin_mc.mute_mc._visible = false;
} else {
ctrls[4] = {ctrlType:"mutebtn", ctrlName:"mute_mc", xachor:1, yachor:0, x:hUsage2 - 18, y:5, width:18, height:18, parent:"panel_mc"};
hUsage2 = hUsage2 + -23;
}
if (paramObj.noProcBar) {
skin_mc.proc_mc._visible = false;
} else {
ctrls[3] = {ctrlType:"procbar", ctrlName:"proc_mc", xachor:0, yachor:0, x:100, y:13, width:400, height:1, leftBand:hUsage, rightBand:-hUsage2, parent:"panel_mc"};
}
ctrls[6] = {ctrlType:"panel", ctrlName:"panel_mc_left", xachor:0, yachor:0, x:0, y:0, width:15, height:27, parent:"panel_mc"};
ctrls[7] = {ctrlType:"panel", ctrlName:"panel_mc_right", xachor:1, yachor:0, x:-15, y:0, width:15, height:27, parent:"panel_mc"};
ctrls[8] = {ctrlType:"panel", ctrlName:"panel_mc_mid", xachor:0, yachor:0, x:0, y:0, width:0, height:27, leftBand:15, rightBand:15, parent:"panel_mc"};
ctrls[9] = {ctrlType:"color_panel", ctrlName:"color_panel_mc_right", xachor:1, yachor:0, x:-15, y:0, width:15, height:27, parent:"panel_mc"};
ctrls[10] = {ctrlType:"color_panel", ctrlName:"color_panel_mc_left", xachor:0, yachor:0, x:0, y:0, width:15, height:27, parent:"panel_mc"};
ctrls[11] = {ctrlType:"color_panel", ctrlName:"color_panel_mc_mid", xachor:0, yachor:0, x:0, y:0, width:0, height:27, leftBand:15, rightBand:15, parent:"panel_mc"};
ctrls[12] = {ctrlType:"gray_panel", ctrlName:"gray_panel", xachor:1, yachor:0, x:-15, y:0, width:15, height:27, parent:"root_ctrl"};
ctrls[13] = {ctrlType:"replay_panel", ctrlName:"replay_panel", xachor:2, yachor:2, x:-45, y:-15, width:90, height:30, parent:"root_ctrl"};
ctrls[14] = {ctrlType:"video_link", ctrlName:"videolink", xachor:0, yachor:0, x:0, y:0, width:0, height:0, parent:"root_ctrl"};
if (paramObj.noTimeText) {
skin_mc.time_panel._visible = false;
} else {
ctrls[15] = {ctrlType:"time_panel", ctrlName:"time_panel", xachor:1, yachor:0, x:-156, y:-2, width:65, height:15, parent:"panel_mc"};
}
paramObj.elements = ctrls;
FillDefaultParam(paramObj);
if (thePlayer != undefined) {
thePlayer.Destroy();
thePlayer = undefined;
}
thePlayer = CreateMoyeaPlayer(paramObj);
var eventCatcher = new Object();
this.createTextField("SubBox", this.getNextHighestDepth(), 0, (thePlayer.totalHeight - thePlayer.playerHeight) - 40, thePlayer.totalWidth, 40);
SubBox.selectable = false;
SubBox.textColor = 16711680 /* 0xFF0000 */;
eventCatcher.SubBox = SubBox;
if (paramObj.subHeight != undefined) {
SubBox._height = paramObj.subHeight;
} else {
SubBox._height = 40;
}
var fmt = new TextFormat();
fmt.align = "center";
if (paramObj.subBold != undefined) {
fmt.bold = paramObj.subBold;
} else {
fmt.bold = true;
}
if (paramObj.subSize != undefined) {
fmt.size = paramObj.subSize;
} else {
fmt.size = 20;
}
fmt.font = paramObj.subFont;
if (paramObj.subColor != undefined) {
fmt.color = paramObj.subColor;
} else {
fmt.color = 16711680 /* 0xFF0000 */;
}
SubBox.setNewTextFormat(fmt);
SubBox._visible = false;
eventCatcher.hideSubBox = function (p) {
clearInterval(p.hideSubBoxTimer);
p.hideSubBoxTimer = undefined;
p.SubBox._visible = false;
};
var thumbNailInit = false;
eventCatcher.onEvent = function (sender, t, n, info) {
if (n == "onResize") {
if (thumbNailInit) {
thumbnail_layer._x = info.x;
thumbnail_layer._y = info.y;
thumbnail_layer._width = info.w;
thumbnail_layer._height = info.h;
}
this.SubBox._x = 0;
this.SubBox._y = (info.y + info.h) - this.SubBox._height;
this.SubBox._width = sender.totalWidth;
} else if (n == "onCuePoint") {
if (info.name == "my::title") {
this.SubBox.text = info.parameters.t;
this.SubBox._visible = true;
clearInterval(this.hideSubBoxTimer);
this.hideSubBoxTimer = setInterval(this.hideSubBox, Number(info.parameters.d), this);
}
}
if (sender.GetState() == "stop") {
thumbnail_layer._visible = true;
} else {
thumbnail_layer._visible = false;
}
};
thePlayer.AddListener(eventCatcher);
if ((thePlayer.param.thumbNail != undefined) && (thePlayer.param.thumbNail != "")) {
var loader = new MovieClipLoader();
var loader_cb = new Object();
loader_cb.player = thePlayer;
loader_cb.onLoadInit = function (mc) {
thumbNailInit = true;
this.player.AdjustControls();
};
loader.addListener(loader_cb);
loader.loadClip(thePlayer.param.thumbNail, thumbnail_layer);
} else {
thumbNailInit = true;
}
if (thePlayer.param.preLoader != undefined) {
preloader_layer.loadMovie(thePlayer.param.preLoader);
}
if (thePlayer.param.bigPlay != undefined) {
bigplay_layer.loadMovie(thePlayer.param.bigPlay);
}
if (thePlayer.param.playerExt != undefined) {
extswf_layer.loadMovie(thePlayer.param.playerExt);
}
Symbol 1 MovieClip Frame 1
function UpdatePreloader(mc) {
if (mc._parent.thePlayer == undefined) {
loader_text.text = "0% loaded";
return(undefined);
}
if (!objAdded) {
objAdded = true;
mc._alpha = 80;
PreloaderInit(mc, mc._parent.thePlayer);
}
loader_text.text = (int(mc._parent.thePlayer.playback.GetPercentage() * 100) / 100) + "% loaded";
if ((mc._visible && (mc._parent.thePlayer.playback.GetPercentage() >= 100)) && (!isLoaded)) {
mc._parent.thePlayer.Play();
mc._visible = false;
isLoaded = true;
}
}
function RelocateControls(tw, th) {
preloader._x = (tw / 2) - 45;
preloader._y = ((th / 2) - 40) - (loader_text._height / 2);
loader_text._x = preloader._x + 15;
loader_text._y = preloader._y + 100;
}
function PreloaderInit(mc, player) {
var _local2 = new Object();
_local2.player = player;
_local2.mc = mc;
_local2.onEvent = function (sender, t, n, d) {
if (n == "onResize") {
trace("hello");
RelocateControls(sender.totalWidth, sender.totalHeight);
} else if (n == "onBufferEmpty") {
this.mc._visible = true;
IsBuffering = true;
} else if (n == "onBufferFull") {
this.mc._visible = false;
IsBuffering = false;
} else if (n == "onPlaying") {
if (this.player.param.targetType == "eflv") {
this.mc._visible = false;
}
}
};
player.AddListener(_local2);
player.AdjustControls();
}
var objAdded = false;
var isLoaded = false;
var IsBuffering = true;
this.tmrUpdate = setInterval(UpdatePreloader, 100, this);
RelocateControls(Stage.width, Stage.height);
debug.text = this._parent._x;
Symbol 10 MovieClip Frame 1
function UpdatePreloader(mc) {
if (mc._parent.thePlayer == undefined) {
return(undefined);
}
if (!mc.objAdded) {
mc.objAdded = true;
clearInterval(mc.tmrUpdate);
mc.thePlayer = mc._parent.thePlayer;
mc._alpha = 100;
Init(mc, mc._parent.thePlayer);
}
}
function RelocateControls(player) {
var _local2 = 0;
var _local3 = 0;
var _local5;
var _local4;
if (player.param.playBtnW != undefined) {
_local5 = player.param.playBtnW;
}
if (player.param.playBtnH != undefined) {
_local4 = player.param.playBtnH;
}
if (_local5 == undefined) {
_local5 = player.totalWidth / 5;
}
if (_local4 == undefined) {
_local4 = player.totalWidth / 5;
}
if (player.param.playBtnAlign == "top-left") {
_local2 = 0;
_local3 = 0;
} else if (player.param.playBtnAlign == "top-center") {
_local2 = (player.totalWidth / 2) - (_local5 / 2);
} else if (player.param.playBtnAlign == "top-right") {
_local2 = player.totalWidth - _local5;
} else if (player.param.playBtnAlign == "left-center") {
_local3 = (player.totalHeight / 2) - (_local4 / 2);
} else if (player.param.playBtnAlign == "right-center") {
_local2 = player.totalWidth - _local5;
_local3 = (player.totalHeight / 2) - (_local4 / 2);
} else if (player.param.playBtnAlign == "center") {
_local2 = (player.totalWidth / 2) - (_local5 / 2);
_local3 = (player.totalHeight / 2) - (_local4 / 2);
} else if (player.param.playBtnAlign == "bottom-left") {
_local2 = 0;
_local3 = player.totalHeight - _local4;
} else if (player.param.playBtnAlign == "bottom-center") {
_local2 = (player.totalWidth / 2) - (_local5 / 2);
_local3 = player.totalHeight - _local4;
} else if (player.param.playBtnAlign == "bottom-right") {
_local2 = player.totalWidth - _local5;
_local3 = player.totalHeight - _local4;
}
if (player.param.playBtnAlignX != undefined) {
_local2 = _local2 + player.param.playBtnAlignX;
}
if (player.param.playBtnAlignY != undefined) {
_local3 = _local3 + player.param.playBtnAlignY;
}
playbtn._width = _local5;
playbtn._height = _local4;
if ((_local2 + _local5) > player.totalWidth) {
_local2 = player.totalWidth - _local5;
}
if (_local2 < 0) {
_local2 = 0;
}
if ((_local3 + _local4) > player.totalHeight) {
_local3 = player.totalHeight - _local4;
}
if (_local3 < 0) {
_local3 = 0;
}
playbtn._x = _local2;
playbtn._y = _local3;
grayLayer._x = 0;
grayLayer._y = 0;
grayLayer._width = player.totalWidth;
grayLayer._height = player.totalHeight;
}
function Init(mc, player) {
var _local2 = new Object();
_local2.player = player;
_local2.mc = mc;
_local2.onEvent = function (sender, t, n, d) {
if (n == "onResize") {
RelocateControls(this.player);
}
if (this.player.GetState() == "play") {
this.mc.playbtn._visible = false;
this.mc.grayLayer._visible = false;
} else {
this.mc.playbtn._visible = true;
this.mc.grayLayer._visible = true;
}
};
player.AddListener(_local2);
player.AdjustControls();
}
var objAdded = false;
var thePlayer;
playbtn._visible = false;
pausebtn._visible = false;
this.tmrUpdate = setInterval(UpdatePreloader, 100, this);
Instance of Symbol 17 MovieClip "playbtn" in Symbol 10 MovieClip Frame 1
on (press) {
_parent.thePlayer.Play();
}