function LEvent(e) {
this.eventType = e;
this._ll_preventDefault = false
}
function LStageAlign() {
throw "LStageAlign cannot be instantiated"
}
function LStageScaleMode() {
throw "LStageScaleMode cannot be instantiated"
}
function trace() {
if (!LGlobal.traceDebug) return;
var e = document.getElementById("traceObject"),
t;
if (trace.arguments.length > 0 && e == null) {
e = document.createElement("TEXTAREA");
e.id = "traceObject";
e.style.position = "absolute";
e.style.top = LGlobal.height + 20 + "px";
e.style.width = LGlobal.width + "px";
e.style.height = "200px";
document.body.appendChild(e)
}
for (t = 0; t < trace.arguments.length; t++) {
e.value = e.value + trace.arguments[t] + "\r\n";
e.scrollTop = e.scrollHeight
}
}
function addChild(e) {
LGlobal.stage.addChild(e)
}
function removeChild(e) {
LGlobal.stage.removeChild(e)
}
function init(e, t, n, r, i, s) {
// updateShare(0);
LGlobal.speed = e;
var o = function() {
if (LGlobal.canTouch && LGlobal.aspectRatio == LANDSCAPE && window.innerWidth < window.innerHeight) {
LGlobal.horizontalError()
} else if (LGlobal.canTouch && LGlobal.aspectRatio == PORTRAIT && window.innerWidth > window.innerHeight) {
LGlobal.verticalError()
} else {
setTimeout(i, 100)
}
LGlobal.startTimer = (new Date).getTime()
};
if (s != null && s == LEvent.INIT) {
LGlobal.frameRate = setInterval(function() {
LGlobal.onShow()
}, e);
LGlobal.setCanvas(t, n, r);
o()
} else {
LEvent.addEventListener(window, "load", function() {
LGlobal.frameRate = setInterval(function() {
LGlobal.onShow()
}, e);
LGlobal.setCanvas(t, n, r);
o()
})
}
}
function base(e, t, n) {
var r = null,
i = e.constructor.prototype,
s = {};
if (e.constructor.name == "Object") {
console.warn("When you use the extends. You must make a method like 'XX.prototype.xxx=function(){}'. but not 'XX.prototype={xxx:function(){}}'.")
}
if (typeof e.__ll__parent__ == UNDEFINED) {
e.__ll__parent__ = [];
e.__ll__parent__ = []
}
e.__ll__parent__.push(t.prototype);
for (r in i) {
s[r] = 1
}
for (r in t.prototype) {
if (!s[r]) {
i[r] = t.prototype[r]
}
}
if (i.toString == Object.prototype.toString) {
i.toString = LObject.prototype.toString
}
t.apply(e, n)
}
function getTimer() {
return (new Date).getTime() - LGlobal.startTimer
}
function getExtension(e) {
var t, n = /([^#?]+\.)([^.#?]+)/;
t = e.match(n);
if (t.length >= 3) {
return t[2].toLowerCase()
}
return null
}
function LBlendMode() {
throw "LBlendMode cannot be instantiated"
}
function LoadingSample2(e, t, n) {
base(this, LSprite, []);
var r = this,
i = LGlobal.canvas,
s = "Loading...",
o;
r.backgroundColor = t == null ? "#000000" : t;
r.graphics.drawRect(1, r.backgroundColor, [0, 0, LGlobal.width, LGlobal.height], true, r.backgroundColor);
if (n == null) n = LGlobal._create_loading_color();
r.color = n;
r.progress = 0;
r.size = e == null ? LGlobal.height * .2 : e;
o = new LTextField;
o.text = s;
o.size = r.size;
o.color = "#ffffff";
o.x = (LGlobal.width - o.getWidth()) / 2;
o.y = (LGlobal.height - r.size) / 2;
r.addChild(o);
r.backLabel = o;
o = new LTextField;
o.text = "***%";
o.size = r.size * .3;
o.color = n;
o.x = (LGlobal.width - o.getWidth()) / 2;
o.y = (LGlobal.height - r.size) / 2 - r.size * .4;
r.addChild(o);
r.progressLabel = o;
o = new LTextField;
o.text = s;
o.size = r.size;
o.color = r.color;
o.x = (LGlobal.width - o.getWidth()) / 2;
o.y = (LGlobal.height - r.size) / 2;
o.mask = new LGraphics;
r.screenX = o.x;
r.screenY = o.y;
r.screenWidth = o.getWidth();
r.addChild(o);
r.showLabel = o;
i.shadowOffsetX = 2;
i.shadowOffsetY = 2;
i.shadowColor = "blue";
r.setProgress(r.progress)
}
function LoadingSample3(e, t, n) {
base(this, LSprite, []);
var r = this,
i = LGlobal.canvas;
r.backgroundColor = t == null ? "#000000" : t;
r.graphics.drawRect(1, r.backgroundColor, [0, 0, LGlobal.width, LGlobal.height], true, r.backgroundColor);
if (n == null) n = LGlobal._create_loading_color();
r.color = n;
r.progress = 0;
r.screenWidth = LGlobal.width * .75;
r.screenHeight = e == null ? LGlobal.height * .1 : e;
if (r.screenHeight > 5) r.screenHeight = 5;
r.screenX = (LGlobal.width - r.screenWidth) / 2;
r.screenY = (LGlobal.height - r.screenHeight) / 2;
r.back = new LSprite;
r.addChild(r.back);
r.label = new LTextField;
r.label.color = "#ffffff";
r.label.weight = "bolder";
r.label.size = r.screenHeight * 2;
r.label.x = r.screenX + (r.screenWidth - r.label.getWidth()) * .5;
r.label.y = r.screenY - r.screenHeight * 4;
r.addChild(r.label);
r.star = new Array;
r.addEventListener(LEvent.ENTER_FRAME, r.onframe);
r.setProgress(r.progress)
}
function LoadingSample4(e, t, n) {
base(this, LSprite, []);
var r = this,
i = LGlobal.canvas;
r.backgroundColor = t == null ? "#000000" : t;
r.graphics.drawRect(1, r.backgroundColor, [0, 0, LGlobal.width, LGlobal.height], true, r.backgroundColor);
if (n == null) n = "#FFFFFF";
r.arc = new LSprite;
r.arc.x = LGlobal.width * .5;
r.arc.y = LGlobal.height * .5;
r.addChild(r.arc);
for (var s = 0; s < 360; s++) {
r.arc.graphics.drawArc(1 + s / 36, n, [0, 0, 50, 2 * Math.PI / 360 * s, 2 * Math.PI / 360 * (s + 2)])
}
r.progress = 0;
r.label = new LTextField;
r.label.color = n;
r.label.weight = "bolder";
r.label.size = 18;
r.label.x = LGlobal.width * .5;
r.label.y = LGlobal.height * .5 - r.label.getHeight() * .5;
r.addChild(r.label);
var o = new LDropShadowFilter(0, 0, "#FFFFFF", 30);
r.arc.filters = [o];
r.addEventListener(LEvent.ENTER_FRAME, r.onframe);
r.setProgress(r.progress)
}
function LoadingSample5(e, t, n) {
base(this, LSprite, []);
var r = this,
i = LGlobal.canvas;
r.backgroundColor = t == null ? "#000000" : t;
r.graphics.drawRect(1, r.backgroundColor, [0, 0, LGlobal.width, LGlobal.height], true, r.backgroundColor);
if (n == null) n = "#FFFFFF";
r.arc = new LSprite;
r.arc.x = LGlobal.width * .5;
r.arc.y = LGlobal.height * .5;
r.addChild(r.arc);
var s = 50;
for (var o = 0; o < 360; o += 30) {
var u = new LSprite;
u.graphics.drawArc(0, n, [s, 0, 7, 0, 2 * Math.PI], true, n);
u.rotate = o;
u.alpha = .1 + o / 360;
r.arc.addChild(u)
}
r.index = 0;
r.max = 3;
r.progress = 0;
r.label = new LTextField;
r.label.color = "#FFFFFF";
r.label.weight = "bolder";
r.label.size = 18;
r.label.x = LGlobal.width * .5;
r.label.y = LGlobal.height * .5 - r.label.getHeight() * .5;
r.addChild(r.label);
var a = new LDropShadowFilter(0, 0, "#FFFFFF", 30);
r.arc.filters = [a];
r.addEventListener(LEvent.ENTER_FRAME, r.onframe);
r.setProgress(r.progress)
}
function LoadingSample6(e, t, n) {
var r = this;
base(r, LSprite, []);
r.progress = 0;
r.step = 0;
r.holeR = e || 10;
r.holeAmount = 5;
r.holesx = 20;
r.loadingBarWidth = r.holeR * 2 * r.holeAmount + r.holesx * (r.holeAmount - 1);
r.loadingBarHeight = r.holeR * 2;
r.progressColor = t || "#2187e7";
r.filterColor = n || "#00c6ff";
r.backLayer = new LSprite;
r.backLayer.graphics.drawRect(0, "", [0, 0, LGlobal.width, LGlobal.height], true, "#161616");
r.addChild(r.backLayer);
r.holeLayer = new LSprite;
r.holeLayer.x = (LGlobal.width - r.loadingBarWidth) * .5;
r.holeLayer.y = (LGlobal.height - r.loadingBarHeight) * .5;
r.addChild(r.holeLayer);
r.progressLayer = new LSprite;
r.progressLayer.x = (LGlobal.width - r.loadingBarWidth) * .5;
r.progressLayer.y = (LGlobal.height - r.loadingBarHeight) * .5;
r.addChild(r.progressLayer);
r._addHole()
}
function LoadingSample7(e, t, n) {
var r = this;
base(r, LSprite, []);
r.progress = 0;
r.step = 0;
r.holeW = e || 10;
r.holeH = t || 30;
r.holeAmount = 10;
r.holesx = 8;
r.loadingBarWidth = r.holeW * r.holeAmount + r.holesx * (r.holeAmount - 1);
r.loadingBarHeight = r.holeH;
r.progressColor = n || "#2187e7";
r.backLayer = new LSprite;
r.backLayer.graphics.drawRect(0, "", [0, 0, LGlobal.width, LGlobal.height], true, "#161616");
r.addChild(r.backLayer);
r.holeLayer = new LSprite;
r.holeLayer.x = (LGlobal.width - r.loadingBarWidth) * .5;
r.holeLayer.y = (LGlobal.height - r.loadingBarHeight) * .5;
r.addChild(r.holeLayer);
r.progressLayer = new LSprite;
r.progressLayer.x = (LGlobal.width - r.loadingBarWidth) * .5;
r.progressLayer.y = (LGlobal.height - r.loadingBarHeight) * .5;
r.addChild(r.progressLayer);
r._addHole()
}
var OS_PC = "pc",
OS_IPHONE = "iPhone",
OS_IPOD = "iPod",
OS_IPAD = "iPad",
OS_ANDROID = "Android",
OS_WINDOWS_PHONE = "Windows Phone",
OS_BLACK_BERRY = "BlackBerry",
NONE = "none",
UNDEFINED = "undefined",
LANDSCAPE = "landscape",
PORTRAIT = "portrait",
mouseX, mouseY;
LEvent.prototype.preventDefault = function() {
this._ll_preventDefault = true
};
LEvent.INIT = "init";
LEvent.COMPLETE = "complete";
LEvent.ENTER_FRAME = "enter_frame";
LEvent.WINDOW_RESIZE = "resize";
LEvent.SOUND_COMPLETE = "sound_complete";
LEvent.END_CONTACT = "endContact";
LEvent.PRE_SOLVE = "preSolve";
LEvent.POST_SOLVE = "postSolve";
LEvent.BEGIN_CONTACT = "beginContact";
LEvent.addEventListener = function(e, t, n, r) {
if (r == null) {
r = false
}
if (e.addEventListener) {
e.addEventListener(t, n, r)
} else if (e.attachEvent) {
e["e" + t + n] = n;
e[t + n] = function() {
e["e" + t + n]()
};
e.attachEvent("on" + t, e[t + n])
}
};
LEvent.removeEventListener = function(e, t, n, r) {
if (r == null) {
r = false
}
if (e.removeEventListener) {
e.removeEventListener(t, n, r)
} else if (e.detachEvent) {
e["e" + t + n] = n;
e[t + n] = function() {
e["e" + t + n]()
};
e.detachEvent("on" + t, e[t + n])
}
};
var LMouseEvent = function() {
throw "LMouseEvent cannot be instantiated"
};
LMouseEvent.MOUSE_DOWN = "mousedown";
LMouseEvent.MOUSE_UP = "mouseup";
LMouseEvent.TOUCH_START = "touchstart";
LMouseEvent.TOUCH_MOVE = "touchmove";
LMouseEvent.TOUCH_END = "touchend";
LMouseEvent.MOUSE_MOVE = "mousemove";
LMouseEvent.MOUSE_OVER = "mouseover";
LMouseEvent.MOUSE_OUT = "mouseout";
LMouseEvent.DOUBLE_CLICK = "dblclick";
var LMultitouchInputMode = function() {
throw "LMultitouchInputMode cannot be instantiated"
};
LMultitouchInputMode.NONE = "none";
LMultitouchInputMode.GESTURE = "gesture";
LMultitouchInputMode.TOUCH_POINT = "touchPoint";
var LMultitouch = function() {
throw "LMultitouch cannot be instantiated"
};
LMultitouch.inputMode = "none";
LMultitouch.touchs = [];
var LTextEvent = function() {
throw "LTextEvent cannot be instantiated"
};
LTextEvent.TEXT_INPUT = "textInput";
LTextEvent.WIND_COMPLETE = "windComplete";
var LFocusEvent = function() {
throw "LFocusEvent cannot be instantiated"
};
LFocusEvent.FOCUS_IN = "focusIn";
LFocusEvent.FOCUS_OUT = "focusOut";
var LMouseEventContainer = function() {
function e() {
var e = this;
e.container = {};
e.dispatchAllEvent = false;
e.mouseDownContainer = [];
e.mouseUpContainer = [];
e.mouseMoveContainer = [];
e.mouseOverContainer = [];
e.mouseOutContainer = [];
e.mouseDblContainer = [];
e.textFieldInputContainer = [];
e.buttonContainer = []
}
e.prototype = {
pushInputBox: function(e) {
var t = this,
n = t.textFieldInputContainer,
r, i;
for (r = 0, i = n.length; r < i; r++) {
if (e.objectIndex == n[r].objectIndex) {
return
}
}
t.textFieldInputContainer.push(e)
},
removeInputBox: function(e) {
var t = this,
n = t.textFieldInputContainer,
r, i;
for (r = 0, i = n.length; r < i; r++) {
if (e.objectIndex == n[r].objectIndex) {
t.textFieldInputContainer.splice(r, 1);
break
}
}
},
pushButton: function(e) {
var t = this,
n = t.buttonContainer,
r, i;
for (r = 0, i = n.length; r < i; r++) {
if (e.objectIndex == n[r].objectIndex) {
return
}
}
t.buttonContainer.push(e)
},
removeButton: function(e) {
var t = this,
n = t.buttonContainer,
r, i;
for (r = 0, i = n.length; r < i; r++) {
if (e.objectIndex == n[r].objectIndex) {
t.buttonContainer.splice(r, 1);
break
}
}
},
dispatchEventButton: function(e) {
var t = this,
n = t.buttonContainer,
r, i;
for (r = 0, i = n.length; r < i; r++) {
if (typeof t.buttonContainer[r].ll_button_mode == "function") {
t.buttonContainer[r].ll_button_mode(e)
}
}
},
addEvent: function(e, t, n) {
var r = this;
t.push({
container: e,
listener: n
})
},
removeEvent: function(e, t, n) {
var r = this,
i, s;
for (i = 0, s = t.length; i < s; i++) {
if (t[i].container.objectIndex === e.objectIndex && (!n || t[i].listener == n)) {
t.splice(i, 1);
break
}
}
},
addMouseDownEvent: function(e, t) {
var n = this;
n.addEvent(e, n.mouseDownContainer, t)
},
addMouseUpEvent: function(e, t) {
var n = this;
n.addEvent(e, n.mouseUpContainer, t)
},
addMouseMoveEvent: function(e, t) {
var n = this;
n.addEvent(e, n.mouseMoveContainer, t)
},
addMouseOverEvent: function(e, t) {
var n = this;
n.addEvent(e, n.mouseOverContainer, t)
},
addMouseOutEvent: function(e, t) {
var n = this;
n.addEvent(e, n.mouseOutContainer, t)
},
addMouseDblEvent: function(e, t) {
var n = this;
n.addEvent(e, n.mouseDblContainer, t)
},
addMouseEvent: function(e, t, n) {
var r = this;
if (t == LMouseEvent.MOUSE_DOWN) {
r.addMouseDownEvent(e, n)
} else if (t == LMouseEvent.MOUSE_UP) {
r.addMouseUpEvent(e, n)
} else if (t == LMouseEvent.MOUSE_OVER) {
r.addMouseOverEvent(e, n)
} else if (t == LMouseEvent.MOUSE_OUT) {
r.addMouseOutEvent(e, n)
} else if (t == LMouseEvent.MOUSE_MOVE) {
r.addMouseMoveEvent(e, n)
} else {
r.addMouseDblEvent(e, n)
}
},
hasEvent: function(e, t) {
for (var n = 0, r = t.length; n < r; n++) {
if (t[n].container.objectIndex === e.objectIndex) {
return true
}
}
return false
},
removeMouseDownEvent: function(e, t) {
var n = this;
n.removeEvent(e, n.mouseDownContainer, t)
},
removeMouseUpEvent: function(e, t) {
var n = this;
n.removeEvent(e, n.mouseUpContainer, t)
},
removeMouseMoveEvent: function(e, t) {
var n = this;
n.removeEvent(e, n.mouseMoveContainer, t)
},
removeMouseOverEvent: function(e, t) {
var n = this;
n.removeEvent(e, n.mouseOverContainer, t)
},
removeMouseOutEvent: function(e, t) {
var n = this;
n.removeEvent(e, n.mouseOutContainer, t)
},
removeMouseDblEvent: function(e, t) {
var n = this;
n.removeEvent(e, n.mouseDblContainer, t)
},
removeMouseEvent: function(e, t, n) {
var r = this;
if (t == LMouseEvent.MOUSE_DOWN) {
r.removeMouseDownEvent(e, n)
} else if (t == LMouseEvent.MOUSE_UP) {
r.removeMouseUpEvent(e, n)
} else if (t == LMouseEvent.MOUSE_OVER) {
r.removeMouseOverEvent(e, n)
} else if (t == LMouseEvent.MOUSE_OUT) {
r.removeMouseOutEvent(e, n)
} else if (t == LMouseEvent.MOUSE_MOVE) {
r.removeMouseMoveEvent(e, n)
} else {
r.removeMouseDblEvent(e, n)
}
},
dispatchMouseEvent: function(e, t) {
var n = this;
if (t == LMouseEvent.MOUSE_DOWN) {
n.dispatchEvent(e, n.mouseDownContainer, LMouseEvent.MOUSE_DOWN);
n.dispatchEvent(e, n.textFieldInputContainer)
} else if (t == LMouseEvent.MOUSE_UP) {
n.dispatchEvent(e, n.mouseUpContainer, LMouseEvent.MOUSE_UP)
} else if (t == LMouseEvent.DOUBLE_CLICK) {
n.dispatchEvent(e, n.mouseDblContainer, LMouseEvent.DOUBLE_CLICK)
} else {
n.dispatchEventButton(e);
n.dispatchEvent(e, n.mouseOutContainer, LMouseEvent.MOUSE_OUT);
n.dispatchEvent(e, n.mouseOverContainer, LMouseEvent.MOUSE_OVER);
n.dispatchEvent(e, n.mouseMoveContainer, LMouseEvent.MOUSE_MOVE)
}
},
getRootParams: function(e) {
var t = e.parent,
n = {
x: 0,
y: 0,
scaleX: 1,
scaleY: 1
};
while (t != "root") {
n.x *= t.scaleX;
n.y *= t.scaleY;
n.x += t.x;
n.y += t.y;
n.scaleX *= t.scaleX;
n.scaleY *= t.scaleY;
t = t.parent
}
return n
},
_mouseEnabled: function(e) {
var t = this;
if (!e || !e.parent || e.parent == "root") {
return false
}
if (!e.visible || typeof e.mouseEnabled != UNDEFINED && !e.mouseEnabled) {
return false
}
var n = e.parent;
while (n != "root") {
if (!n.mouseEnabled || !n.mouseChildren) {
return false
}
n = n.parent;
if (!n) {
return false
}
}
return true
},
dispatchEvent: function(e, t, n) {
var r = this,
i, s, o = [],
u, a, f;
for (a = 0, f = t.length; a < f; a++) {
i = t[a].container || t[a];
if (!r._mouseEnabled(i)) {
continue
}
s = r.getRootParams(i);
if (!n && i.mouseEvent) {
i.mouseEvent(e, LMouseEvent.MOUSE_DOWN, s);
continue
}
if (i.ismouseon(e, s)) {
if (n == LMouseEvent.MOUSE_OUT) {
continue
}
if (n == LMouseEvent.MOUSE_OVER) {
if (i.ll_mousein) {
continue
}
}
if (n != LMouseEvent.MOUSE_UP) {
i.ll_mousein = true
}
o.push({
sp: i,
co: s,
listener: t[a].listener
})
} else {
if (n != LMouseEvent.MOUSE_OUT && n != LMouseEvent.MOUSE_OVER) {
continue
}
if (!i.ll_mousein) {
continue
}
i.ll_mousein = false;
o.push({
sp: i,
co: s,
listener: t[a].listener
})
}
}
if (o.length == 0) {
return
}
if (o.length > 1) {
o = o.sort(r._sort.bind(r))
}
f = r.dispatchAllEvent ? o.length : 1;
for (a = 0; a < f && a < o.length; a++) {
u = o[a];
e.currentTarget = e.clickTarget = u.sp;
if (!e.target) {
e.target = u.sp
}
e.event_type = n;
e.selfX = (e.offsetX - u.co.x - u.sp.x) / (u.co.scaleX * u.sp.scaleX);
e.selfY = (e.offsetY - u.co.y - u.sp.y) / (u.co.scaleY * u.sp.scaleY);
u.listener(e, u.sp);
if (f == 1 && a < o.length - 1 && u.sp.objectIndex == o[a + 1].sp.objectIndex) {
o.splice(a, 1);
a--
}
}
},
set: function(e, t) {
this.container[e] = t
},
_sort: function(e, t) {
var n = this,
r, i, s = n._getSort(e.sp),
o = n._getSort(t.sp),
u, a, f;
for (u = 0, a = s.length, f = o.length; u < a && u < f; u++) {
r = s[u];
i = o[u];
if (r.objectIndex == i.objectIndex) {
continue
}
return i.parent.getChildIndex(i) - r.parent.getChildIndex(r)
}
return o.length - s.length
},
_getSort: function(e) {
var t = e.parent,
n = [e];
while (t != "root") {
n.unshift(t);
t = t.parent
}
return n
}
};
return new e
}();
var LKeyboardEvent = function() {
throw "LKeyboardEvent cannot be instantiated"
};
LKeyboardEvent.KEY_DOWN = "keydown";
LKeyboardEvent.KEY_UP = "keyup";
LKeyboardEvent.KEY_PRESS = "keypress";
var LAccelerometerEvent = function() {
throw "LAccelerometerEvent cannot be instantiated"
};
LAccelerometerEvent.DEVICEMOTION = "devicemotion";
LStageAlign.TOP = "T";
LStageAlign.BOTTOM = "B";
LStageAlign.LEFT = "L";
LStageAlign.RIGHT = "Re";
LStageAlign.TOP_LEFT = "TL";
LStageAlign.TOP_RIGHT = "TR";
LStageAlign.TOP_MIDDLE = "TM";
LStageAlign.BOTTOM_LEFT = "BL";
LStageAlign.BOTTOM_RIGHT = "BR";
LStageAlign.BOTTOM_MIDDLE = "BM";
LStageAlign.MIDDLE = "M";
LStageScaleMode.EXACT_FIT = "exactFit";
LStageScaleMode.SHOW_ALL = "showAll";
LStageScaleMode.NO_BORDER = "noBorder";
LStageScaleMode.NO_SCALE = "noScale";
var LGlobal = function() {
function e() {
throw "LGlobal cannot be instantiated"
}
e.FULL_SCREEN = "full_screen";
e.traceDebug = false;
e.displayState = NONE;
e.aspectRatio = NONE;
e.canvasObj = null;
e.canvas = null;
e.webAudio = true;
e.objectIndex = 1;
e.stage = null;
e.width = 0;
e.height = 0;
e.box2d = null;
e.speed = 50;
e.IS_MOUSE_DOWN = false;
e.preventDefault = true;
e.childList = new Array;
e.dragList = new Array;
e.excludingContainer = new Array;
e.stageScale = "noScale";
e.align = "M";
e.mobile = false;
e.canTouch = false;
e.os = OS_PC;
e.ios = false;
e.android = false;
e.android_new = false;
e.backgroundColor = null;
e.destroy = true;
e.forceRefresh = false;
e.devicePixelRatio = window.devicePixelRatio || 1;
e.startTimer = 0;
e.keepClear = true;
e.top = 0;
e.left = 0;
e.window = window;
(function(t) {
e.isFirefox = t.toLowerCase().indexOf("firefox") >= 0;
if (t.indexOf(OS_IPHONE) > 0) {
e.os = OS_IPHONE;
e.canTouch = true;
e.ios = true
} else if (t.indexOf(OS_IPOD) > 0) {
e.os = OS_IPOD;
e.canTouch = true;
e.ios = true
} else if (t.indexOf(OS_IPAD) > 0) {
e.os = OS_IPAD;
e.ios = true;
e.canTouch = true
} else if (t.indexOf(OS_ANDROID) > 0) {
e.os = OS_ANDROID;
e.canTouch = true;
e.android = true;
var n = t.indexOf(OS_ANDROID);
if (parseInt(t.substr(n + 8, 1)) > 3) {
e.android_new = true
}
} else if (t.indexOf(OS_WINDOWS_PHONE) > 0) {
e.os = OS_WINDOWS_PHONE;
e.canTouch = true
} else if (t.indexOf(OS_BLACK_BERRY) > 0) {
e.os = OS_BLACK_BERRY;
e.canTouch = true
}
e.mobile = e.canTouch
})(navigator.userAgent);
e.setDebug = function(t) {
e.traceDebug = t
};
e.setCanvas = function(t, n, r) {
e.ll_createCanvas(t, n, r);
e.ll_createStage();
if (e.displayState == LStage.FULL_SCREEN) {
e.resize()
} else if (typeof e.displayState == "number") {
e.resize(e.width * e.displayState, e.height * e.displayState)
}
if (e.canTouch) {
e.ll_clicks = 0;
e.ll_prev_clickTime = 0;
LEvent.addEventListener(e.canvasObj, LMouseEvent.TOUCH_START, e.ll_touchStart);
LEvent.addEventListener(document, LMouseEvent.TOUCH_END, e.ll_touchEnd);
LEvent.addEventListener(e.canvasObj, LMouseEvent.TOUCH_MOVE, e.ll_touchMove)
} else {
LEvent.addEventListener(e.canvasObj, LMouseEvent.DOUBLE_CLICK, e.ll_mouseDbclick);
LEvent.addEventListener(e.canvasObj, LMouseEvent.MOUSE_DOWN, e.ll_mouseDown);
LEvent.addEventListener(e.canvasObj, LMouseEvent.MOUSE_MOVE, e.ll_mouseMove);
LEvent.addEventListener(e.canvasObj, LMouseEvent.MOUSE_UP, e.ll_mouseUp);
LEvent.addEventListener(e.canvasObj, LMouseEvent.MOUSE_OUT, e.ll_mouseOut)
}
};
e.ll_createCanvas = function(t, n, r) {
e.id = t;
e.object = document.getElementById(t);
e.object.innerHTML = '
' + '
" + '' + '' + '' + '
';
e.canvasObj = document.getElementById(e.id + "_canvas");
e._canvas = document.createElement("canvas");
e._context = e._canvas.getContext("2d");
if (e._context) {
e.canvasObj.innerHTML = ""
}
e.inputBox = document.getElementById(e.id + "_InputText");
e.inputTextareaBoxObj = document.getElementById(e.id + "_InputTextareaBox");
e.inputTextBoxObj = document.getElementById(e.id + "_InputTextBox");
e.passwordBoxObj = document.getElementById(e.id + "_passwordBox");
e.inputTextField = null;
if (n) {
e.canvasObj.width = n
}
if (r) {
e.canvasObj.height = r
}
e.width = e.canvasObj.width;
e.height = e.canvasObj.height;
e.canvasStyleWidth = e.width;
e.canvasStyleHeight = e.height;
e.canvas = e.canvasObj.getContext("2d");
e.offsetX = mouseX = 0;
e.offsetY = mouseY = 0
};
e.ll_createStage = function() {
e.stage = new LSprite;
e.stage.parent = "root";
e.childList.push(e.stage);
e.stage.baseAddEvent = e.stage.addEventListener;
e.stage.baseRemoveEvent = e.stage.removeEventListener;
e.stage.addEventListener = function(t, n) {
if (t == LEvent.WINDOW_RESIZE) {
e.stage.onresizeListener = n;
e.stage.onresize = function(t) {
e.stage.onresizeEvent = t
};
LEvent.addEventListener(e.window, t, e.stage.onresize)
} else if (t == LKeyboardEvent.KEY_DOWN || t == LKeyboardEvent.KEY_UP || t == LKeyboardEvent.KEY_PRESS) {
LEvent.addEventListener(e.window, t, n)
} else {
e.stage.baseAddEvent(t, n)
}
};
e.stage.removeEventListener = function(t, n) {
if (t == LEvent.WINDOW_RESIZE) {
LEvent.removeEventListener(e.window, LEvent.WINDOW_RESIZE, e.stage.onresize);
delete e.stage.onresize;
delete e.stage.onresizeListener
} else if (t == LKeyboardEvent.KEY_DOWN || t == LKeyboardEvent.KEY_UP || t == LKeyboardEvent.KEY_PRESS) {
LEvent.removeEventListener(e.window, t, n)
} else {
e.stage.baseRemoveEvent(t, n)
}
}
};
e.ll_touchStart = function(t) {
if (e.inputBox.style.display != NONE) {
e.inputTextField._ll_getValue()
}
var n, r, i, s, o;
n = parseInt(0 + e.object.style.left) + parseInt(e.canvasObj.style.marginLeft);
r = parseInt(0 + e.object.style.top) + parseInt(e.canvasObj.style.marginTop);
if (LMultitouch.inputMode == LMultitouchInputMode.NONE) {
i = e.ll_touchStartEvent(t, 0, n, r)
} else if (LMultitouch.inputMode == LMultitouchInputMode.TOUCH_POINT) {
for (var o = 0, u = t.touches.length; o < u; o++) {
if (!LMultitouch.touchs["touch" + t.touches[o].identifier]) {
i = e.ll_touchStartEvent(t, o, n, r)
}
}
}
var a = new Date;
var f = a.getTime();
e.ll_clicks = f <= e.ll_prev_clickTime + 500 ? e.ll_clicks + 1 : 1;
e.ll_prev_clickTime = f;
if (e.ll_clicks === 2) {
e.mouseEvent(i, LMouseEvent.DOUBLE_CLICK);
e.ll_clicks = 0
}
e.IS_MOUSE_DOWN = true;
if (e.mouseJoint_start) {
e.mouseJoint_start(i)
}
e.touchHandler(t)
};
e.ll_touchStartEvent = function(t, n, r, i) {
var s = {
offsetX: t.touches[n].pageX - r,
offsetY: t.touches[n].pageY - i,
touchPointID: t.touches[n].identifier
};
s.offsetX = e.ll_scaleX(s.offsetX);
s.offsetY = e.ll_scaleY(s.offsetY);
mouseX = e.offsetX = s.offsetX;
mouseY = e.offsetY = s.offsetY;
LMultitouch.touchs["touch" + s.touchPointID] = s;
e.mouseEvent(s, LMouseEvent.MOUSE_DOWN);
e.buttonStatusEvent = s;
return s
};
e.ll_touchEnd = function(t) {
var n, r, i, s, o, u;
if (LMultitouch.inputMode == LMultitouchInputMode.TOUCH_POINT) {
for (i in LMultitouch.touchs) {
n = LMultitouch.touchs[i];
u = false;
for (s = 0, o = t.touches.length; s < o; s++) {
if (t.touches[s].identifier == n.touchPointID) {
u = true;
break
}
}
if (!u) {
r = n;
delete LMultitouch.touchs[i];
e.mouseEvent(r, LMouseEvent.MOUSE_UP)
}
}
}
if (!r) {
r = {
offsetX: e.offsetX,
offsetY: e.offsetY
}
}
e.mouseEvent(r, LMouseEvent.MOUSE_UP);
e.touchHandler(t);
e.IS_MOUSE_DOWN = false;
e.buttonStatusEvent = null;
if (e.mouseJoint_end) {
e.mouseJoint_end()
}
};
e.ll_touchMove = function(t) {
var n, r, s, o, u = t.touches.length;
n = parseInt(0 + e.object.style.left) + parseInt(e.canvasObj.style.marginLeft);
r = parseInt(0 + e.object.style.top) + parseInt(e.canvasObj.style.marginTop);
if (LMultitouch.inputMode == LMultitouchInputMode.NONE) {
u = 1
}
for (i = 0, o = t.touches.length; i < o && i < u; i++) {
s = {
offsetX: t.touches[i].pageX - n,
offsetY: t.touches[i].pageY - r,
touchPointID: t.touches[i].identifier
};
s.offsetX = e.ll_scaleX(s.offsetX);
s.offsetY = e.ll_scaleY(s.offsetY);
mouseX = e.offsetX = s.offsetX;
mouseY = e.offsetY = s.offsetY;
if (LMultitouch.touchs["touch" + s.touchPointID] && LMultitouch.touchs["touch" + s.touchPointID].offsetX == s.offsetX && LMultitouch.touchs["touch" + s.touchPointID].offsetY == s.offsetY) {
continue
}
e.buttonStatusEvent = s;
LMultitouch.touchs["touch" + s.touchPointID] = s;
e.mouseEvent(s, LMouseEvent.MOUSE_MOVE)
}
e.touchHandler(t);
if (e.mouseJoint_move) {
e.mouseJoint_move(s)
}
};
e.ll_mouseDbclick = function(t) {
if (t.offsetX == null && t.layerX != null) {
t.offsetX = t.layerX;
t.offsetY = t.layerY
}
var n = {
button: t.button
};
n.offsetX = e.ll_scaleX(t.offsetX);
n.offsetY = e.ll_scaleY(t.offsetY);
e.mouseEvent(n, LMouseEvent.DOUBLE_CLICK)
};
e.ll_mouseDown = function(t) {
if (t.offsetX == null && t.layerX != null) {
t.offsetX = t.layerX;
t.offsetY = t.layerY
}
if (e.inputBox.style.display != NONE) {
e.inputTextField._ll_getValue()
}
var n = {
button: t.button
};
n.offsetX = e.ll_scaleX(t.offsetX);
n.offsetY = e.ll_scaleY(t.offsetY);
e.mouseEvent(n, LMouseEvent.MOUSE_DOWN);
e.IS_MOUSE_DOWN = true;
if (e.mouseJoint_start) {
e.mouseJoint_start(n)
}
};
e.ll_mouseMove = function(t) {
if (t.offsetX == null && t.layerX != null) {
t.offsetX = t.layerX;
t.offsetY = t.layerY
}
var n = {};
n.offsetX = e.ll_scaleX(t.offsetX);
n.offsetY = e.ll_scaleY(t.offsetY);
e.buttonStatusEvent = n;
mouseX = e.offsetX = n.offsetX;
mouseY = e.offsetY = n.offsetY;
e.cursor = "default";
e.mouseEvent(n, LMouseEvent.MOUSE_MOVE);
document.body.style.cursor = e.cursor;
if (e.mouseJoint_move) {
e.mouseJoint_move(n)
}
};
e.ll_mouseUp = function(t) {
if (t.offsetX == null && t.layerX != null) {
t.offsetX = t.layerX;
t.offsetY = t.layerY
}
var n = {
button: t.button
};
n.offsetX = e.ll_scaleX(t.offsetX);
n.offsetY = e.ll_scaleY(t.offsetY);
e.mouseEvent(n, LMouseEvent.MOUSE_UP);
e.IS_MOUSE_DOWN = false;
if (e.mouseJoint_end) {
e.mouseJoint_end()
}
};
e.ll_mouseOut = function(t) {
if (t.offsetX == null && t.layerX != null) {
t.offsetX = t.layerX;
t.offsetY = t.layerY
}
var n = {};
n.offsetX = e.ll_scaleX(t.offsetX);
n.offsetY = e.ll_scaleY(t.offsetY);
e.mouseEvent(n, LMouseEvent.MOUSE_OUT);
e.IS_MOUSE_DOWN = false
};
e.touchHandler = function(t) {
t.stopPropagation();
if (e.preventDefault) {
t.preventDefault()
}
if (t.stopImmediatePropagation) {
t.stopImmediatePropagation()
}
return t
};
e.mouseEvent = function(t, n) {
if (n == LMouseEvent.MOUSE_MOVE) {
e.dragHandler(t)
}
if (LMouseEventContainer.container[n]) {
LMouseEventContainer.dispatchMouseEvent(t, n);
return
}
for (var r = e.childList.length - 1; r >= 0; r--) {
if (e.childList[r].mouseEvent && e.childList[r].mouseEvent(t, n)) {
break
}
}
};
e.dragHandler = function(t) {
var n, r, i, s = e.dragList;
for (n = s.length - 1; n >= 0; n--) {
r = s[n];
if (e.canTouch && r.ll_touchPointID != t.touchPointID) {
continue
}
i = r.getAbsoluteScale();
r.x = r.ll_dragStartX + (t.offsetX - r.ll_dragMX) * r.scaleX / i.scaleX;
r.y = r.ll_dragStartY + (t.offsetY - r.ll_dragMY) * r.scaleY / i.scaleY;
break
}
};
e._ll_mobile = function() {
var t = e.width * .3,
n = t * 1.5,
r = e.width * .05,
i = t * .05,
s = t * .15,
o = t * .3,
u = n * .2,
a = "#cccccc",
f = "#000000",
l = "#ffffff",
c = "#ff0000",
h, t, n, p, d, v, m;
h = new LSprite;
addChild(h);
t = e.width * .3, n = t * 1.5;
h.graphics.drawRoundRect(1, f, [r, r, t, n, r], true, a);
h.graphics.drawRoundRect(1, f, [r + i, r + i, t - i * 2, n - i * 2, r], true, f);
h.graphics.drawRect(1, l, [r + s, r + u, t - s * 2, n - u * 2], true, l);
h.graphics.drawArc(1, l, [r + t * .5, r + n - i * 3.5, i * 1.5, 0, 2 * Math.PI]);
h.graphics.drawRoundRect(1, l, [r + o, r + s, t - o * 2, i, i * .5]);
p = new LSprite;
p.x = -(t - s * 2) * .5;
p.y = -i * .5;
p.graphics.drawRect(1, c, [0, 0, t - s * 2, i], true, c);
d = new LSprite;
d.y = -(t - s * 2) * .5;
d.x = -i * .5;
d.graphics.drawRect(1, c, [0, 0, i, t - s * 2], true, c);
v = new LSprite;
v.x = r + o + (t - o * 2) * .5;
v.y = r + u + (n - u * 2) * .5;
v.rotate = 45;
v.addChild(p);
v.addChild(d);
h.addChild(v);
m = new LSprite;
m.graphics.drawVertices(2, f, [
[0, 0],
[s, s],
[0, s * 2]
], true, a);
m.x = r * 1.5 + n;
m.y = r * 1.5 + n * .5;
addChild(m);
h.arrow = m;
var g = function() {
setTimeout(function() {
location.href = location.href
}, 100)
};
window.onorientationchange = g;
return h
};
e.verticalError = function() {
var t = e.width * .3,
n = e.width * .05;
var r = e._ll_mobile();
var i = r.clone();
i.getChildAt(0).visible = false;
i.x = e.width * .5 + n;
addChild(i);
r.rotate = 90;
r.x = e.width * .5 + n;
r.y = t * .5
};
e.horizontalError = function() {
var t = e.width * .3,
n = e.width * .05;
var r = e._ll_mobile();
var i = r.clone();
i.getChildAt(0).visible = false;
i.rotate = 90;
i.x = e.width - n;
i.y = t * .5;
addChild(i);
r.arrow.x = n * 1.5 + t
};
e.onShow = function() {
if (e.canvas == null) {
return
}
if (e.stage.onresizeEvent) {
e.stage.onresizeListener(e.stage.onresizeEvent);
delete e.stage.onresizeEvent
}
if (e.forceRefresh) {
e.canvasObj.width = e.canvasObj.width;
e.forceRefresh = false
}
if (e.box2d != null) {
e.box2d.ll_show();
if (!e.traceDebug && e.keepClear) {
e.canvas.clearRect(0, 0, e.width + 1, e.height + 1)
}
} else {
if (e.keepClear) {
e.canvas.clearRect(0, 0, e.width + 1, e.height + 1)
}
if (e.backgroundColor !== null) {
e.canvas.fillStyle = e.backgroundColor;
e.canvas.fillRect(0, 0, e.width, e.height)
}
}
e.show(e.childList)
};
e.show = function(e) {
for (var t = 0, n = e.length; t < n; t++) {
if (e[t] && e[t].ll_show) {
e[t].ll_show()
}
}
};
e.divideCoordinate = function(e, t, n, r) {
var i, s, o = e / r,
u = t / n,
a = [],
f;
for (i = 0; i < n; i++) {
f = [];
for (s = 0; s < r; s++) {
f.push({
x: o * s,
y: u * i,
width: o,
height: u
})
}
a.push(f)
}
return a
};
e._create_loading_color = function() {
var t = e.canvas.createRadialGradient(e.width / 2, e.height, 0, e.width / 2, 0, e.height);
t.addColorStop(0, "red");
t.addColorStop(.3, "orange");
t.addColorStop(.4, "yellow");
t.addColorStop(.5, "green");
t.addColorStop(.8, "blue");
t.addColorStop(1, "violet");
return t
};
e.hitPolygon = function(e, t, n) {
var r = 0,
i = e[0],
s = t <= i[0],
o = n <= i[1],
u, a, f, l, c;
for (u = 1, a = e.length; u < a + 1; u++) {
f = e[u % a];
l = t <= f[0];
c = n <= f[1];
if (o != c) {
if (s == l) {
if (s) {
r += o ? -1 : 1
}
} else {
if (t <= i[0] + (f[0] - i[0]) * (n - i[1]) / (f[1] - i[1])) {
r += o ? -1 : 1
}
}
}
i = f;
s = l;
o = c
}
return 0 != r
};
e.hitTestPolygon = function(e, t) {
var n, r, i, s, o, u, a = [
[e, [],
[]
],
[t, [],
[]
]
];
for (r = 0; r < a.length; r++) {
s = a[r][0], o = a[r][1];
for (n = 0, i = s.length; n < i; n++) {
a[r][2].push(new LVec2(s[n][0], s[n][1]));
if (n < i - 1) {
o.push((new LVec2(s[n + 1][0] - s[n][0], s[n + 1][1] - s[n][1])).normL())
}
}
o.push((new LVec2(s[0][0] - s[i - 1][0], s[0][1] - s[i - 1][1])).normL())
}
for (r = 0; r < a.length; r++) {
o = a[r][1];
for (n = 0, i = o.length; n < i; n++) {
var f = LVec2.getMinMax(a[0][2], o[n]);
var l = LVec2.getMinMax(a[1][2], o[n]);
if (f.max_o < l.min_o || f.min_o > l.max_o) {
return false
}
}
}
return true
};
e.hitTestPolygonArc = function(t, n) {
if (e.hitPolygon(t, n[0], n[1])) {
return true
}
var r, i, s, o, u, a, f, l, c, h;
for (r = 0, s = t.length; r < s; r++) {
i = r < s - 1 ? r + 1 : 0;
o = t[r], u = t[i];
a = new LVec2(n[0] - o[0], n[1] - o[1]), f = new LVec2(u[0] - o[0], u[1] - o[1]);
h = f.normalize();
c = LVec2.dot(a, h);
if (c <= 0) {
if (a.x * a.x + a.y * a.y < n[3]) {
return true
}
} else if (c * c < f.x * f.x + f.y * f.y) {
l = LVec2.cross(a, h);
if (l * l < n[3]) {
return true
}
}
}
return false
};
e.hitTestArc = function(e, t, n, r) {
var i = e.getWidth() * .5,
s = t.getWidth() * .5,
o = e._startX ? e._startX() : e.startX(),
u = t._startX ? t._startX() : t.startX(),
a = e._startY ? e._startY() : e.startY(),
f = t._startY ? t._startY() : t.startY();
if (typeof n != UNDEFINED) {
o += i - n;
a += i - n;
i = n
}
if (typeof r != UNDEFINED) {
u += s - r;
f += s - r;
s = r
}
var l = o + i - u - s,
c = a + i - f - s;
return l * l + c * c < (i + s) * (i + s)
};
e.hitTestRect = function(e, t, n, r) {
var i = e.getWidth(),
s = t.getWidth(),
o = e.getHeight(),
u = t.getHeight(),
a = e._startX ? e._startX() : e.startX(),
f = t._startX ? t._startX() : t.startX(),
l = e._startY ? e._startY() : e.startY(),
c = t._startY ? t._startY() : t.startY();
if (typeof n != UNDEFINED) {
a += (i - n[0]) * .5;
l += (o - n[1]) * .5;
i = n[0];
o = n[1]
}
if (typeof r != UNDEFINED) {
f += (s - r[0]) * .5;
c += (u - r[1]) * .5;
s = r[0];
u = r[1]
}
var h = a > f ? a : f,
p = l > c ? l : c,
d = a + i > f + s ? f + s : a + i,
v = l + o > c + u ? c + u : l + o;
return h <= d && p <= v
};
e.hitTest = e.hitTestRect;
e.setFrameRate = function(t) {
if (e.frameRate) {
clearInterval(e.frameRate)
}
e.speed = t;
e.frameRate = setInterval(function() {
e.onShow()
}, t)
};
e.ll_scaleX = function(t) {
return (t - e.left) * e.width / e.canvasStyleWidth
};
e.ll_scaleY = function(t) {
return (t - e.top) * e.height / e.canvasStyleHeight
};
e.ll_setStageSize = function(t, n) {
t = Math.ceil(t);
n = Math.ceil(n);
e.canvasObj.style.width = t + "px";
e.canvasObj.style.height = n + "px";
e.canvasStyleWidth = t;
e.canvasStyleHeight = n
};
e.resize = function(t, n) {
var r, i, s = 0,
o = 0,
u = window.innerWidth,
a = window.innerHeight;
if (t) {
r = t
}
if (n) {
i = n
}
if (e.stageScale == "noScale") {
r = t || e.width;
i = n || e.height
}
switch (e.stageScale) {
case "exactFit":
r = t || u;
i = n || a;
break;
case "noBorder":
r = t || u;
i = n || e.height * u / e.width;
switch (e.align) {
case LStageAlign.BOTTOM:
case LStageAlign.BOTTOM_LEFT:
case LStageAlign.BOTTOM_RIGHT:
case LStageAlign.BOTTOM_MIDDLE:
s = a - i;
break
}
break;
case "showAll":
if (u / a > e.width / e.height) {
i = n || a;
r = t || e.width * a / e.height
} else {
r = t || u;
i = n || e.height * u / e.width
};
case "noScale":
default:
switch (e.align) {
case LStageAlign.BOTTOM:
case LStageAlign.BOTTOM_LEFT:
s = a - i;
break;
case LStageAlign.RIGHT:
case LStageAlign.TOP_RIGHT:
o = u - r;
break;
case LStageAlign.TOP_MIDDLE:
o = (u - r) * .5;
break;
case LStageAlign.BOTTOM_RIGHT:
s = a - i;
o = u - r;
break;
case LStageAlign.BOTTOM_MIDDLE:
s = a - i;
o = (u - r) * .5;
break;
case LStageAlign.MIDDLE:
s = (a - i) * .5;
o = (u - r) * .5;
break;
case LStageAlign.TOP:
case LStageAlign.LEFT:
case LStageAlign.TOP_LEFT:
default:
}
}
e.canvasObj.style.marginTop = s + "px";
e.canvasObj.style.marginLeft = o + "px";
if (e.isFirefox) {
e.left = parseInt(e.canvasObj.style.marginLeft);
e.top = parseInt(e.canvasObj.style.marginTop)
}
e.ll_setStageSize(r, i)
};
e.sleep = function(e) {
var t = new Date;
while ((new Date).getTime() - t.getTime() < e) {}
};
e.screen = function(t) {
e.displayState = t;
if (e.stage) {
if (typeof e.displayState == "number") {
e.resize(e.width * e.displayState, e.height * e.displayState)
} else {
e.resize()
}
}
};
return e
}();
var LSystem = LGlobal;
var LStage = LGlobal;
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function(e) {
var t = this.length >>> 0;
var n = Number(arguments[1]) || 0;
n = n < 0 ? Math.ceil(n) : Math.floor(n);
if (n < 0) {
n += t
}
for (; n < t; n++) {
if (n in this && this[n] === e) {
return n
}
}
return -1
}
}
if (!Array.isArray) {
Array.isArray = function(e) {
return Object.prototype.toString.apply(e) == "[object Array]"
}
}
if (!Function.prototype.bind) {
Function.prototype.bind = function(e) {
if (typeof this !== "function") {
throw new TypeError("Function.prototype.bind-what is trying to be bound is not callable")
}
var t = Array.prototype.slice.call(arguments, 1),
n = this,
r = function() {},
i = function() {
return n.apply(this instanceof r && e ? this : e, t.concat(Array.prototype.slice.call(arguments)))
};
r.prototype = this.prototype;
i.prototype = new r;
return i
}
}
if (!Array.prototype.find) {
Array.prototype.find = function(e) {
if (this == null) {
throw new TypeError("Array.prototype.find called on null or undefined")
}
if (typeof e !== "function") {
throw new TypeError("predicate must be a function")
}
var t = Object(this);
var n = t.length >>> 0;
var r = arguments[1];
var i;
for (var s = 0; s < n; s++) {
i = t[s];
if (e.call(r, i, s, t)) {
return i
}
}
return undefined
}
}
if (!Array.prototype.findIndex) {
Array.prototype.findIndex = function(e) {
if (this == null) {
throw new TypeError("Array.prototype.find called on null or undefined")
}
if (typeof e !== "function") {
throw new TypeError("predicate must be a function")
}
var t = Object(this);
var n = t.length >>> 0;
var r = arguments[1];
var i;
for (var s = 0; s < n; s++) {
i = t[s];
if (e.call(r, i, s, t)) {
return s
}
}
return -1
}
}
if (!Array.prototype.forEach) {
Array.prototype.forEach = function(e, t) {
var n, r;
if (this == null) {
throw new TypeError(" this is null or not defined")
}
var i = Object(this);
var s = i.length >>> 0;
if (typeof e !== "function") {
throw new TypeError(e + " is not a function")
}
if (arguments.length > 1) {
n = t
}
r = 0;
while (r < s) {
var o;
if (r in i) {
o = i[r];
e.call(n, o, r, i)
}
r++
}
}
}
if (!Array.prototype.every) {
Array.prototype.every = function(e, t) {
"use strict";
var n, r;
if (this == null) {
throw new TypeError("this is null or not defined")
}
var i = Object(this);
var s = i.length >>> 0;
if (typeof e !== "function") {
throw new TypeError
}
if (arguments.length > 1) {
n = t
}
r = 0;
while (r < s) {
var o;
if (r in i) {
o = i[r];
var u = e.call(n, o, r, i);
if (!u) {
return false
}
}
r++
}
return true
}
}
if (!Array.prototype.some) {
Array.prototype.some = function(e) {
"use strict";
if (this == null) {
throw new TypeError("Array.prototype.some called on null or undefined")
}
if (typeof e !== "function") {
throw new TypeError
}
var t = Object(this);
var n = t.length >>> 0;
var r = arguments.length >= 2 ? arguments[1] : void 0;
for (var i = 0; i < n; i++) {
if (i in t && e.call(r, t[i], i, t)) {
return true
}
}
return false
}
}
if (!window.console) {
window.console = {
log: trace,
warn: trace
}
}
var LInit = init;
var LExtends = base;
var LObject = function() {
function e() {
this.type = "LObject";
this.objectIndex = ++LGlobal.objectIndex;
this.objectindex = this.objectIndex
}
e.prototype = {
callParent: function(e, t) {
if (!e || !t) {
return
}
var n = this,
r = false,
i, s = "__ll__parent_call" + e;
if (typeof n[s] == "undefined") {
r = true;
n[s] = 0
} else {
n[s]++
} if (n[s] >= n.__ll__parent__.length) {
return false
}
if (!n.__ll__parent__[n[s]][e]) {
i = n.callParent(e, t)
} else {
i = n.__ll__parent__[n[s]][e].apply(n, t)
} if (r) {
delete n[s]
}
return i
},
toString: function() {
return "[object " + this.constructor.name + "]"
}
};
return e
}();
var LColorTransform = function() {
function e(e, t, n, r, i, s, o, u) {
var a = this;
LExtends(a, LObject, []);
a.redMultiplier = e;
a.greenMultiplier = t;
a.blueMultiplier = n;
a.alphaMultiplier = r;
a.redOffset = i;
a.greenOffset = s;
a.blueOffset = o;
a.alphaOffset = u
}
return e
}();
var LMatrix = function() {
function e(e, t, n, r, i, s, o, u, a) {
var f = this;
f.a = 1;
f.b = 0;
f.u = 0;
f.c = 0;
f.d = 1;
f.v = 0;
f.tx = 0;
f.ty = 0;
f.w = 1;
if (typeof e != UNDEFINED) {
f.a = e
}
if (typeof t != UNDEFINED) {
f.b = t
}
if (typeof n != UNDEFINED) {
f.c = n
}
if (typeof r != UNDEFINED) {
f.d = r
}
if (typeof i != UNDEFINED) {
f.tx = i
}
if (typeof s != UNDEFINED) {
f.ty = s
}
if (typeof o != UNDEFINED) {
f.u = o
}
if (typeof u != UNDEFINED) {
f.v = u
}
if (typeof a != UNDEFINED) {
f.w = a
}
}
e.prototype = {
setTo: function(e, t, n, r, i, s, o, u, a) {
var f = this;
if (typeof e != UNDEFINED) {
f.a = e
}
if (typeof t != UNDEFINED) {
f.b = t
}
if (typeof n != UNDEFINED) {
f.c = n
}
if (typeof r != UNDEFINED) {
f.d = r
}
if (typeof i != UNDEFINED) {
f.tx = i
}
if (typeof s != UNDEFINED) {
f.ty = s
}
if (typeof o != UNDEFINED) {
f.u = o
}
if (typeof u != UNDEFINED) {
f.v = u
}
if (typeof a != UNDEFINED) {
f.w = a
}
return f
},
isIdentity: function() {
var e = this;
return e.a == 1 && e.b == 0 && e.c == 0 && e.d == 1 && e.tx == 0 && e.ty == 0 && u == 0 && v == 0 && w == 1
},
transform: function(e) {
var t = this;
e.transform(t.a, t.b, t.c, t.d, t.tx, t.ty);
return t
},
toString: function() {
return "[object LMatrix]"
},
identity: function() {
this.setTo(1, 0, 0, 1, 0, 0, 0, 0, 1)
},
rotate: function(t) {
var n = this,
r = t * Math.PI / 180,
i = Math.cos(r),
s = Math.sin(r),
o = new e(i, s, -s, i, 0, 0, 0, 0, 1);
n.add(o)
},
scale: function(t, n) {
var r = this,
i = new e(t, 0, 0, n, 0, 0, 0, 0, 1);
r.add(i)
},
translate: function(t, n) {
var r = this,
i = new e(1, 0, 0, 1, t, n, 0, 0, 1);
r.add(i)
},
skew: function(t, n) {
mtx = new e(0, n, t, 0, 0, 0, 0, 0, 1);
s.add(mtx)
},
add: function(e) {
var t = this,
n, r, i, s, o, u, a, f, l;
n = t.a * e.a + t.b * e.c + t.u * e.tx;
r = t.a * e.b + t.b * e.d + t.u * e.ty;
a = t.a * e.u + t.b * e.v + t.u * e.w;
i = t.c * e.a + t.d * e.c + t.v * e.tx;
s = t.c * e.b + t.d * e.d + t.v * e.ty;
f = t.c * e.u + t.d * e.v + t.v * e.w;
o = t.tx * e.a + t.ty * e.c + t.w * e.tx;
u = t.tx * e.b + t.ty * e.d + t.w * e.ty;
l = t.tx * e.u + t.ty * e.v + t.w * e.w;
t.setTo(n, r, i, s, o, u, a, f, l)
},
toArray: function(e) {
var t = this;
if (Array.isArray(e) && e.length == 3) {
var n = e[0] * t.a + e[1] * t.c + e[2] * t.tx,
r = e[0] * t.b + e[1] * t.d + e[2] * t.ty,
i = e[0] * t.u + e[1] * t.v + e[2] * t.w;
return [n, r, i]
} else {
var s = t.a * e.a + t.b * e.c + t.u * e.tx,
o = t.a * e.b + t.b * e.d + t.u * e.ty,
u = t.a * e.u + t.b * e.v + t.u * e.w,
a = t.c * e.a + t.d * e.c + t.v * e.tx,
f = t.c * e.b + t.d * e.d + t.v * e.ty,
l = t.c * e.u + t.d * e.v + t.v * e.w,
c = t.tx * e.a + t.ty * e.c + t.w * e.tx,
h = t.tx * e.b + t.ty * e.d + t.w * e.ty,
p = t.tx * e.u + t.ty * e.v + t.w * e.w;
return [s, o, a, f, c, h, u, l, p]
}
},
clone: function() {
var t = this;
return new e(t.a, t.b, t.c, t.d, t.tx, t.ty, t.u, t.v, t.w)
}
};
return e
}();
var LVec2 = function() {
function e(e, t) {
this.x = e || 0;
this.y = t || 0
}
e.dot = function(e, t) {
return e.x * t.x + e.y * t.y
};
e.cross = function(e, t) {
return e.x * t.y - e.y * t.x
};
e.distance = function(e, t) {
var n = e.x - t.x;
var r = e.y - t.y;
return Math.sqrt(n * n + r * r)
};
e.getMinMax = function(t, n) {
var r = e.dot(t[0], n);
var i = e.dot(t[0], n);
var s = 0;
var o = 0;
for (var u = 1; u < t.length; u++) {
var a = e.dot(t[u], n);
if (r > a) {
r = a;
s = u
}
if (i < a) {
i = a;
o = u
}
}
var f = {
min_o: r,
min_i: s,
max_o: i,
max_i: o
};
return f
};
e.prototype = {
length: function() {
var e = this;
return Math.sqrt(e.x * e.x + e.y * e.y)
},
normalize: function() {
var t = this,
n = t.length();
return new e(t.x / n, t.y / n)
},
normR: function() {
return new e(-this.y, this.x)
},
normL: function() {
return new e(this.y, -this.x)
}
};
return e
}();
var LEventDispatcher = function() {
function e() {
var e = this;
LExtends(e, LObject, []);
e._eventList = new Array
}
var t = {
addEventListener: function(e, t) {
this._eventList.push({
listener: t,
type: e
})
},
removeEventListener: function(e, t) {
var n = this,
r, i;
i = n._eventList.length;
for (r = 0; r < i; r++) {
if (!n._eventList[r]) {
continue
}
if (e == n._eventList[r].type && n._eventList[r].listener == t) {
n._eventList.splice(r, 1);
return
}
}
},
removeAllEventListener: function() {
this._eventList = []
},
dispatchEvent: function(e) {
var t = this,
n, r = t._eventList.length,
i = typeof e == "string" ? e : e.eventType;
for (n = 0; n < r; n++) {
if (!t._eventList[n]) {
continue
}
if (i == t._eventList[n].type) {
if (typeof e == "string") {
t.currentTarget = t.target = t;
t.eventType = t.event_type = i;
t._eventList[n].listener(t)
} else {
if (!e.target) {
e.target = t
}
if (!e.currentTarget) {
e.currentTarget = e.target
}
e._ll_preventDefault = false;
t._eventList[n].listener(e);
if (e._ll_preventDefault) {
return false
}
}
return true
}
}
return false
},
hasEventListener: function(e, t) {
var n = this,
r, i = n._eventList.length;
for (r = 0; r < i; r++) {
if (!n._eventList[r]) {
continue
}
if (e == n._eventList[r].type) {
if (typeof t == UNDEFINED || t == n._eventList[r].listener) {
return true
}
}
}
return false
}
};
for (var n in t) {
e.prototype[n] = t[n]
}
return e
}();
var LDisplayObject = function() {
function e() {
var e = this;
LExtends(e, LEventDispatcher, []);
e.name = "instance" + e.objectIndex;
e.x = 0;
e.y = 0;
e.width = 0;
e.height = 0;
e.scaleX = 1;
e.scaleY = 1;
e.alpha = 1;
e.visible = true;
e.rotate = 0;
e.mask = null;
e.blendMode = null;
e.filters = null
}
var t = {
_createCanvas: function() {
var e = this;
if (!e._canvas) {
e._canvas = document.createElement("canvas");
e._context = e._canvas.getContext("2d")
}
},
ll_show: function() {
var e = this,
t = LGlobal.canvas;
if (!e._canShow()) {
return
}
if (!LGlobal.box2d && typeof e._ll_loopframe == "function") {
e._ll_loopframe()
}
t.save();
e._showReady(t);
if (e.blendMode) {
t.globalCompositeOperation = e.blendMode
}
if (e.filters) {
e._ll_setShadow()
}
e._rotateReady();
if (e.mask != null && e.mask.ll_show) {
e.mask.ll_show();
t.clip()
}
e._transformRotate();
e._transformScale();
e._coordinate(t);
if (e.alpha < 1) {
t.globalAlpha = e.alpha
}
e._ll_show(t);
t.restore();
if (LGlobal.box2d != null && typeof e._ll_loopframe == "function") {
e._ll_loopframe()
}
},
_canShow: function() {
return this.visible
},
_coordinate: function(e) {
var t = this;
if (t.x != 0 || t.y != 0) {
e.transform(1, 0, 0, 1, t.x, t.y)
}
},
_rotateReady: function() {},
_showReady: function(e) {},
_ll_show: function(e) {},
_ll_setShadow: function() {
var e = this,
t = e.filters,
n, r;
if (!t) {
return
}
for (n = 0, r = t.length; n < r; n++) {
t[n].ll_show()
}
},
_transformRotate: function() {
var e = this,
t;
if (e.rotate == 0) {
return
}
t = LGlobal.canvas, rotateFlag = Math.PI / 180, rotateObj = new LMatrix;
if (typeof e.rotatex == UNDEFINED) {
e.rotatex = 0;
e.rotatey = 0
}
if (e.box2dBody) {
rotateFlag = 1
}
rotateObj.a = Math.cos(e.rotate * rotateFlag);
rotateObj.b = Math.sin(e.rotate * rotateFlag);
rotateObj.c = -rotateObj.b;
rotateObj.d = rotateObj.a;
rotateObj.tx = e.x + e.rotatex;
rotateObj.ty = e.y + e.rotatey;
rotateObj.transform(t).setTo(1, 0, 0, 1, -rotateObj.tx, -rotateObj.ty).transform(t)
},
_transformScale: function() {
var e = this,
t = LGlobal.canvas,
n;
if (e.scaleX == 1 && e.scaleY == 1) {
return
}
n = new LMatrix;
if (e.scaleX != 1) {
n.tx = e.x
}
if (e.scaleY != 1) {
n.ty = e.y
}
n.a = e.scaleX;
n.d = e.scaleY;
n.transform(t).setTo(1, 0, 0, 1, -n.tx, -n.ty).transform(t)
},
copyProperty: function(e) {
var t = this,
n;
for (n in e) {
if (typeof e[n] == "number" || typeof e[n] == "string" || typeof e[n] == "boolean") {
if (n == "objectindex" || n == "objectIndex") {
continue
}
t[n] = e[n]
} else if (Array.isArray(e[n])) {
t[n] = e[n].slice()
}
}
if (e.mask) {
t.mask = e.mask.clone()
}
},
getAbsoluteScale: function() {
var e = this,
t, n, r;
t = e.scaleX;
n = e.scaleY;
r = e.parent;
while (r && r != "root") {
t *= r.scaleX;
n *= r.scaleY;
r = r.parent
}
return {
scaleX: t,
scaleY: n
}
},
getRootCoordinate: function() {
var e = this,
t, n, r;
t = e.x;
n = e.y;
r = e.parent;
while (r && r != "root") {
t *= r.scaleX;
n *= r.scaleY;
t += r.x;
n += r.y;
r = r.parent
}
return new LPoint(t, n)
},
getBounds: function(e) {
if (typeof e == UNDEFINED) {
return new LRectangle(0, 0, 0, 0)
}
var t = this,
n = 0,
r = 0,
i = 0,
s = 0,
o, u;
if (t.objectIndex != e.objectIndex) {
o = t.getRootCoordinate();
u = e.getRootCoordinate();
n = o.x - u.x;
r = o.y - u.y
}
if (e.getWidth) {
i = e.getWidth()
}
if (e.getHeight) {
s = e.getHeight()
}
return new LRectangle(n, r, i, s)
},
getDataCanvas: function() {
var e = this,
t, n, r, i, s, o;
e._createCanvas();
n = LGlobal.canvasObj;
i = LGlobal.canvas;
t = e._canvas;
r = e._context;
e.width = e.getWidth();
e.height = e.getHeight();
t.width = e.width;
t.height = e.height;
r.clearRect(0, 0, e.width, e.height);
LGlobal.canvasObj = e._canvas;
LGlobal.canvas = e._context;
s = e.x;
o = e.y;
e.x = e.y = 0;
e.ll_show();
e.x = s;
e.y = o;
e._canvas = t;
e._context = r;
LGlobal.canvasObj = n;
LGlobal.canvas = i;
return e._canvas
},
getDataURL: function() {
var e = this,
t = e.getDataCanvas();
return t.toDataURL.apply(t, arguments)
},
ismouseonShapes: function(e, t, n) {
var r = this,
i = r,
s, o, u, a, f;
if (typeof e == UNDEFINED) {
e = r.shapes
}
s = r.getRootMatrix();
for (u = e.length - 1; u >= 0; u--) {
o = e[u];
f = o.arg;
a = r._changeShape(o.type, f, s);
if (o.type == LShape.VERTICES) {
if (LGlobal.hitPolygon(a, t, n)) {
return true
}
} else if (o.type == LShape.RECT) {
if (LGlobal.hitPolygon(a, t, n)) {
return true
}
} else if (o.type == LShape.ARC) {
if ((a[0] - t) * (a[0] - t) + (a[1] - n) * (a[1] - n) < a[3]) {
return true
}
}
}
return false
},
_changeShape: function(e, t, n) {
var r, t = t,
i, s, o, u, a;
if (e == LShape.VERTICES) {
r = [];
for (s = 0, o = t.length; s < o; s++) {
r[s] = n.toArray([t[s][0], t[s][1], 1])
}
} else if (e == LShape.RECT) {
r = [
[t[0], t[1]],
[t[0] + t[2], t[1]],
[t[0] + t[2], t[1] + t[3]],
[t[0], t[1] + t[3]]
];
for (s = 0, o = r.length; s < o; s++) {
r[s] = n.toArray([r[s][0], r[s][1], 1])
}
} else if (e == LShape.ARC) {
u = n.toArray([t[0], t[1], 1]);
a = n.toArray([t[0] + t[2], t[1], 1]);
i = (u[0] - a[0]) * (u[0] - a[0]) + (u[1] - a[1]) * (u[1] - a[1]);
r = [u[0], u[1], Math.sqrt(i), i]
}
return r
},
getRootMatrix: function() {
var e = this,
t = new LMatrix;
while (e && e != "root") {
if (e.scaleX != 1 || e.scaleY != 1) {
t.scale(e.scaleX, e.scaleY)
}
if (e.rotate != 0) {
t.rotate(e.rotate)
}
if (e.x != 0 || e.y != 0) {
t.translate(e.x, e.y)
}
e = e.parent
}
return t
},
remove: function() {
var e = this,
t = e.parent;
if (!t || t == "root") {
return
}
t.removeChild(e)
}
};
for (var n in t) {
e.prototype[n] = t[n]
}
return e
}();
var LInteractiveObject = function() {
function e() {
var e = this;
LExtends(e, LDisplayObject, []);
e.type = "LInteractiveObject";
e.mouseEnabled = true;
e.mouseList = new Array
}
var t = {
addEventListener: function(e, t) {
var n = this;
if (e.indexOf("mouse") >= 0 || e.indexOf("touch") >= 0 || e == LMouseEvent.DOUBLE_CLICK) {
if (LMouseEventContainer.container[e] || (e == LMouseEvent.MOUSE_OVER || e == LMouseEvent.MOUSE_OUT) && LMouseEventContainer.container[LMouseEvent.MOUSE_MOVE]) {
LMouseEventContainer.addMouseEvent(n, e, t);
return
}
n.mouseList.push({
listener: t,
type: e
})
} else {
n._eventList.push({
listener: t,
type: e
})
}
},
removeEventListener: function(e, t) {
var n = this,
r, i;
if (e.indexOf("mouse") >= 0 || e.indexOf("touch") >= 0 || e == LMouseEvent.DOUBLE_CLICK) {
if (LMouseEventContainer.container[e] || (e == LMouseEvent.MOUSE_OVER || e == LMouseEvent.MOUSE_OUT) && LMouseEventContainer.container[LMouseEvent.MOUSE_MOVE]) {
LMouseEventContainer.removeMouseEvent(n, e, t);
return
}
i = n.mouseList.length;
for (r = 0; r < i; r++) {
if (!n.mouseList[r]) {
continue
}
if (e == n.mouseList[r].type && n.mouseList[r].listener == t) {
n.mouseList.splice(r, 1);
return
}
}
} else {
return n.callParent("removeEventListener", arguments)
}
},
removeAllEventListener: function() {
var e = this;
e.mouseList.length = 0;
e._eventList.length = 0;
if (LMouseEventContainer.container[LMouseEvent.MOUSE_DOWN]) {
LMouseEventContainer.removeMouseEvent(e, LMouseEvent.MOUSE_DOWN)
}
if (LMouseEventContainer.container[LMouseEvent.MOUSE_UP]) {
LMouseEventContainer.removeMouseEvent(e, LMouseEvent.MOUSE_UP)
}
if (LMouseEventContainer.container[LMouseEvent.MOUSE_MOVE]) {
LMouseEventContainer.removeMouseEvent(e, LMouseEvent.MOUSE_MOVE);
LMouseEventContainer.removeMouseEvent(e, LMouseEvent.MOUSE_OVER);
LMouseEventContainer.removeMouseEvent(e, LMouseEvent.MOUSE_OUT)
}
},
hasEventListener: function(e) {
var t = this,
n, r;
if (e.indexOf("mouse") >= 0 || e.indexOf("touch") >= 0 || e == LMouseEvent.DOUBLE_CLICK) {
r = t.mouseList.length;
for (n = 0; n < r; n++) {
if (!t.mouseList[n]) {
continue
}
if (e == t.mouseList[n].type) {
return true
}
}
} else {
return t.callParent("hasEventListener", arguments)
}
return false
}
};
for (var n in t) {
e.prototype[n] = t[n]
}
return e
}();
var LDisplayObjectContainer = function() {
function e() {
var e = this;
LExtends(e, LInteractiveObject, []);
e.childList = new Array;
e.numChildren = 0;
e.mouseChildren = true
}
var t = {
addChild: function(e) {
var t = this,
n;
if (e.parent) {
n = LGlobal.destroy;
LGlobal.destroy = false;
e.parent.removeChild(e);
LGlobal.destroy = n
}
e.parent = t;
t.childList.push(e);
t.numChildren = t.childList.length;
return e
},
addChildAt: function(e, t) {
var n = this,
r;
if (t < 0 || t > n.childList.length) {
return
}
if (typeof e.remove == "function") {
r = LGlobal.destroy;
LGlobal.destroy = false;
e.remove();
LGlobal.destroy = r
}
e.parent = n;
n.childList.splice(t, 0, e);
n.numChildren = n.childList.length;
return e
},
removeChild: function(e) {
var t = this,
n = t.childList,
r, i;
for (r = 0, i = n.length; r < i; r++) {
if (e.objectIndex == n[r].objectIndex) {
if (LGlobal.destroy && e.die) {
e.die()
}
t.childList.splice(r, 1);
break
}
}
t.numChildren = t.childList.length;
delete e.parent
},
getChildAt: function(e) {
var t = this,
n = t.childList;
if (n.length == 0 || n.length <= e) {
return null
}
return n[e]
},
getChildByName: function(e) {
var t = this,
n = t.childList;
for (i = 0, l = n.length; i < l; i++) {
if (!n[i]) {
continue
}
if (n[i].name == e) {
return n[i]
}
}
return null
},
removeChildAt: function(e) {
var t = this,
n = t.childList;
if (n.length <= e) {
return
}
if (LGlobal.destroy && n[e].die) {
n[e].die()
}
var r = t.childList.splice(e, 1);
t.numChildren = t.childList.length;
return r
},
getChildIndex: function(e) {
if (!e) {
return -1
}
var t = this,
n = t.childList,
r, i = n.length;
for (r = 0; r < i; r++) {
if (n[r].objectIndex == e.objectIndex) {
return r
}
}
return -1
},
setChildIndex: function(e, t) {
var n = this,
r = n.childList,
i, s = r.length;
if (e.parent == "root" || e.parent.objectIndex != n.objectIndex || t < 0 || t >= s) {
return -1
}
for (i = 0; i < s; i++) {
if (r[i].objectIndex == e.objectIndex) {
break
}
}
n.childList.splice(i, 1);
n.childList.splice(t, 0, e);
return t
},
resize: function() {
var e = this;
e.width = e.getWidth();
e.height = e.getHeight()
},
removeAllChild: function() {
var e = this,
t = e.childList,
n, r;
for (n = 0, r = t.length; n < r; n++) {
if (LGlobal.destroy && t[n].die) {
t[n].die()
}
}
e.childList.length = 0;
e.width = 0;
e.height = 0;
e.numChildren = 0
}
};
for (var n in t) {
e.prototype[n] = t[n]
}
return e
}();
var LLoader = function() {
function e() {
var e = this;
LExtends(e, LEventDispatcher, []);
e.type = "LLoader"
}
e.TYPE_BITMAPDATE = "bitmapData";
e.prototype.load = function(t, n) {
var r = this;
if (!n) {
n = e.TYPE_BITMAPDATE
}
r.loadtype = n;
if (n == e.TYPE_BITMAPDATE) {
r.content = new Image;
r.content.onload = function() {
r.content.onload = null;
var e = new LEvent(LEvent.COMPLETE);
e.currentTarget = r;
e.target = r.content;
r.dispatchEvent(e);
delete r.content
};
r.content.src = t
}
};
return e
}();
var LURLLoader = function() {
function e() {
var e = this;
LExtends(e, LEventDispatcher, []);
e.type = "LURLLoader";
e.loadtype = "";
e.content = null;
e.event = {}
}
e.TYPE_TEXT = "text";
e.TYPE_JS = "js";
e.prototype.load = function(t, n) {
var r = this,
i, s;
if (!n) {
s = getExtension(t);
if (s == "txt") {
n = e.TYPE_TEXT
} else if (s == "js") {
n = e.TYPE_JS
}
}
r.loadtype = n;
if (n == e.TYPE_TEXT) {
LAjax.get(t, {}, function(e) {
i = new LEvent(LEvent.COMPLETE);
r.data = e;
i.currentTarget = r;
i.target = e;
r.dispatchEvent(i);
delete r.content;
delete r.data
})
} else if (n == e.TYPE_JS) {
var o = document.createElement("script");
o.onload = function() {
i = new LEvent(LEvent.COMPLETE);
i.currentTarget = r;
i.target = r;
r.dispatchEvent(i);
delete r.content
};
o.src = t;
o.type = "text/javascript";
document.querySelector("head").appendChild(o)
}
};
return e
}();
var LWebAudio = function() {
function e() {
var e = this;
LExtends(e, LEventDispatcher, []);
e.currentTime = 0;
e.currentStart = 0;
e.currentSave = 0;
e.length = 0;
e.loopStart = 0;
e.loopEnd = 0;
e.loopIndex = 0;
e.loopLength = 1;
e.playing = false;
e.volume = 1;
LSound.Container.add(e)
}
e.container = [];
e.containerCount = 0;
e.audioTag = new Audio;
e._context = null;
var t = {
getWebAudio: function() {
var t;
if (e.containerCount > 0) {
t = e.container.shift()
} else {
if (typeof webkitAudioContext !== UNDEFINED) {
try {
t = new webkitAudioContext
} catch (n) {
e.containerCount = e.container.length;
t = e.container.shift()
}
} else if (typeof AudioContext !== UNDEFINED) {
try {
t = new AudioContext
} catch (n) {
e.containerCount = e.container.length;
t = e.container.shift()
}
} else {
throw "AudioContext not supported.:("
}
} if (!t.createGainNode) {
t.createGainNode = t.createGain
}
e.container.push(t);
return t
},
onload: function(e) {
var t = this;
if (Object.prototype.toString.apply(e) !== "[object AudioBuffer]") {
t.load(e);
return
}
if (!t.data) {
t.data = t.getWebAudio()
}
t.buffer = e;
t.length = t.buffer.duration;
var n = new LEvent(LEvent.COMPLETE);
n.currentTarget = t;
n.target = t.buffer;
t.dispatchEvent(n)
},
_onended: function() {
var e = this;
e.dispatchEvent(LEvent.SOUND_COMPLETE);
if (++e.loopIndex < e.loopLength) {
e.play(e.currentStart, undefined, e.currentTimeTo)
} else {
e.close()
}
},
load: function(t) {
var n = this;
if (typeof t !== "string") {
if (Object.prototype.toString.apply(t) == "[object AudioBuffer]") {
n.onload(t)
} else if (Object.prototype.toString.apply(t) == "[object ArrayBuffer]") {
if (!n.data) {
n.data = n.getWebAudio()
}
n.data.decodeAudioData(t, n.onload.bind(n), function(e) {
throw "AudioContext decodeAudioData error:" + e.toString()
})
}
return
}
var r, i, s, o, u, a = {
mov: ["quicktime"],
"3gp": ["3gpp"],
midi: ["midi"],
mid: ["midi"],
ogv: ["ogg"],
m4a: ["acc"],
mp3: ["mpeg"],
wav: ["wav", "x-wav", "wave"],
wave: ["wav", "x-wav", "wave"],
aac: ["mp4", "aac"]
};
r = t.split(",");
for (o = 0; o < r.length; o++) {
i = r[o].split(".");
u = i[i.length - 1];
if (a[u]) {
u = a[u]
} else {
u = [u]
}
s = u.some(function(t, r, i) {
return e.audioTag.canPlayType(n._type + "/" + t)
});
if (s) {
LAjax.responseType = LAjax.ARRAY_BUFFER;
LAjax.get(r[o], {}, n.onload.bind(n));
return
} else {
console.warn("Not support " + i[i.length - 1] + ":" + r[o]);
var f = new LEvent(LEvent.COMPLETE);
f.currentTarget = f.target = n;
n.dispatchEvent(f)
}
}
},
getCurrentTime: function() {
var e = this;
if (e.playing) {
return e.data.currentTime - e.currentSave + e.currentTime
} else {
return e.currentSave
}
},
setVolume: function(e) {
var t = this;
t.volume = e;
if (t.playing) {
t.volumeNode.gain.value = e
}
},
getVolume: function() {
return this.volume
},
play: function(e, t, n) {
var r = this;
if (r.length == 0) {
return
}
if (typeof t !== UNDEFINED) {
r.loopIndex = 0;
r.loopLength = t
}
if (typeof e !== UNDEFINED) {
r.currentTime = e;
r.currentStart = e
}
if (typeof n !== UNDEFINED) {
r.currentTimeTo = n > r.length ? r.length : n
} else {
r.currentTimeTo = r.length
}
r.data.loop = false;
r.playing = true;
if (r.timeout) {
clearTimeout(r.timeout);
delete r.timeout
}
r.timeout = setTimeout(r._onended.bind(r), (r.currentTimeTo - r.currentTime) * 1e3);
r.bufferSource = r.data.createBufferSource();
r.bufferSource.buffer = r.buffer;
r.volumeNode = r.data.createGainNode();
r.volumeNode.gain.value = r.volume;
r.volumeNode.connect(r.data.destination);
r.bufferSource.connect(r.volumeNode);
r.currentSave = r.data.currentTime;
if (r.bufferSource.start) {
r.bufferSource.start(0, r.currentTime, r.length - r.currentTime)
} else {
r.bufferSource.noteGrainOn(0, r.currentTime, r.length - r.currentTime)
}
},
playSegment: function(e, t, n) {
this.playTo(e, e + t, n)
},
playTo: function(e, t, n) {
this.play(e, n, t)
},
stop: function() {
var e = this;
if (!e.playing) {
return
}
if (e.timeout) {
clearTimeout(e.timeout);
delete e.timeout
}
if (e.bufferSource.stop) {
e.bufferSource.stop(0)
} else {
e.bufferSource.noteOff(0)
}
e.currentSave = e.getCurrentTime();
e.currentTime = e.currentSave;
e.playing = false
},
close: function() {
var e = this;
if (!e.playing) {
return
}
if (e.timeout) {
clearTimeout(e.timeout);
delete e.timeout
}
if (e.bufferSource.stop) {
e.bufferSource.stop(0)
} else {
e.bufferSource.noteOff(0)
}
e.playing = false;
e.currentTime = 0;
e.currentSave = 0
},
ll_check: function() {
var e = this;
if (!e.playing) {
return
}
if (e.currentTimeTo < e.data.currentTime - e.currentSave + LSound.Container.time * .001) {
e._onended()
}
},
die: function() {
LSound.Container.remove(this)
}
};
for (var n in t) {
e.prototype[n] = t[n]
}
return e
}();
var LMedia = function() {
function e() {
var e = this;
LExtends(e, LDisplayObject, []);
e.length = 0;
e.loopIndex = 0;
e.loopLength = 1;
e.playing = false;
e.oncomplete = null;
e.onsoundcomplete = null;
e.currentStart = 0;
LSound.Container.add(this)
}
var t = {
onload: function() {
var e = this;
if (e.data.readyState) {
e.length = e.data.duration - (LGlobal.android ? .1 : 0);
var t = new LEvent(LEvent.COMPLETE);
t.currentTarget = e;
t.target = e.data;
e.dispatchEvent(t);
return
}
e.data.addEventListener("canplaythrough", function() {
e.onload()
}, false)
},
_onended: function() {
var e = this,
t, n;
e.dispatchEvent(LEvent.SOUND_COMPLETE);
if (++e.loopIndex < e.loopLength) {
t = e.loopIndex;
n = e.loopLength;
e.close();
e.play(e.currentStart, e.loopLength, e.currentTimeTo);
e.loopIndex = t
} else {
e.close()
}
},
load: function(e) {
var t = this;
if (Object.prototype.toString.apply(e) == "[object HTMLAudioElement]") {
t.data = e;
t.onload();
return
}
var n, r, i, s, o, u = {
mov: ["quicktime"],
"3gp": ["3gpp"],
midi: ["midi"],
mid: ["midi"],
ogv: ["ogg"],
m4a: ["acc"],
mp3: ["mpeg"],
wav: ["wav", "x-wav", "wave"],
wave: ["wav", "x-wav", "wave"],
aac: ["mp4", "aac"]
};
n = e.split(",");
for (s = 0; s < n.length; s++) {
r = n[s].split(".");
o = r[r.length - 1];
if (u[o]) {
o = u[o]
} else {
o = [o]
}
i = o.some(function(e, n, r) {
return t.data.canPlayType(t._type + "/" + e)
});
if (i) {
t.data.src = n[s];
t.onload();
t.data.load();
return
} else {
console.warn("Not support " + r[r.length - 1] + ":" + n[s]);
var a = new LEvent(LEvent.COMPLETE);
a.currentTarget = a.target = t;
t.dispatchEvent(a)
}
}
if (t.oncomplete) {
t.oncomplete({})
}
},
getCurrentTime: function() {
return this.data.currentTime
},
setVolume: function(e) {
this.data.volume = e
},
getVolume: function() {
return this.data.volume
},
play: function(e, t, n) {
var r = this;
if (r.length == 0) {
return
}
if (LGlobal.android) {
LSound.Container.stopOther(this)
}
if (typeof e != UNDEFINED) {
r.data.currentTime = e;
r.currentStart = e
}
if (typeof t != UNDEFINED) {
r.loopLength = t
}
if (typeof n !== UNDEFINED) {
r.currentTimeTo = n > r.length ? r.length : n
} else {
r.currentTimeTo = r.length
} if (r.timeout) {
clearTimeout(r.timeout);
delete r.timeout
}
r.timeout = setTimeout(function() {
r._onended()
}, (r.currentTimeTo - r.data.currentTime) * 1e3);
r.data.loop = false;
r.loopIndex = 0;
r.playing = true;
r.data.play()
},
playSegment: function(e, t, n) {
this.playTo(e, e + t, n)
},
playTo: function(e, t, n) {
this.play(e, n, t)
},
stop: function() {
var e = this;
if (!e.playing) {
return
}
if (e.timeout) {
clearTimeout(e.timeout);
delete e.timeout
}
e.playing = false;
e.data.pause()
},
close: function() {
var e = this;
if (!e.playing) {
return
}
if (e.timeout) {
clearTimeout(e.timeout);
delete e.timeout
}
e.playing = false;
e.data.pause();
e.data.currentTime = 0;
e.currentSave = 0
},
ll_check: function() {
var e = this;
if (!e.playing) {
return
}
if (e.currentTimeTo < e.data.currentTime + LSound.Container.time * .005) {
e._onended()
}
},
die: function() {
LSound.Container.remove(this)
}
};
for (var n in t) {
e.prototype[n] = t[n]
}
return e
}();
var LSound = function() {
function e(t) {
var n = this;
n.type = "LSound";
n._type = "audio";
if (e.webAudioEnabled && LGlobal.webAudio) {
LExtends(n, LWebAudio, [])
} else {
LExtends(n, LMedia, []);
n.data = new Audio;
n.data.loop = false;
n.data.autoplay = false
} if (t) {
n.load(t)
}
}
e.TYPE_SOUND = "sound";
e.webAudioEnabled = false;
var t = location.protocol;
if (t == "http:" || t == "https:") {
if (typeof webkitAudioContext !== UNDEFINED) {
try {
LWebAudio._context = new webkitAudioContext
} catch (n) {}
} else if (typeof AudioContext !== UNDEFINED) {
try {
LWebAudio._context = new AudioContext
} catch (n) {}
}
if (LWebAudio._context) {
LWebAudio.container.push(LWebAudio._context);
e.webAudioEnabled = true
}
}
e.Container = {
ll_save: 0,
time: 0,
list: [],
ll_show: function() {
var t = e.Container;
var n = (new Date).getTime();
t.time = n - (t.ll_save ? t.ll_save : n);
t.ll_save = n;
var r = t.list;
for (var i = r.length - 1; i >= 0; i--) {
if (r[i]) {
r[i].ll_check()
}
}
},
add: function(t) {
if (e.Container.list.indexOf(t) >= 0) {
return
}
e.Container.list.push(t)
},
remove: function(t) {
var n = e.Container.list;
for (var r = n.length - 1; r >= 0; r--) {
if (n[r].objectIndex == t.objectIndex) {
n.splice(r, 1);
break
}
}
},
stopOther: function(t) {
var n = e.Container.list;
for (var r = n.length - 1; r >= 0; r--) {
if (n[r].objectIndex != t.objectIndex) {
n[r].stop()
}
}
}
};
LGlobal.childList.push(e.Container);
return e
}();
var LVideo = function() {
function e(e) {
var t = this;
LExtends(t, LMedia, []);
t.type = "LVideo";
t._type = "video";
t.rotatex = 0;
t.rotatey = 0;
t.data = document.createElement("video");
t.data.style.display = "none";
document.body.appendChild(t.data);
t.data.id = "video_" + t.objectIndex;
t.data.loop = false;
t.data.autoplay = false;
if (e) {
t.load(e)
}
}
var t = {
_ll_show: function(e) {
var t = this;
e.drawImage(t.data, t.x, t.y)
},
die: function() {
var e = this;
document.body.removeChild(e.data);
delete e.data
},
getWidth: function() {
return this.data.width
},
getHeight: function() {
return this.data.height
}
};
for (var n in t) {
e.prototype[n] = t[n]
}
return e
}();
var LPoint = function() {
function e(e, t) {
var n = this;
n.x = e;
n.y = t
}
e.distance = function(t, n) {
return e.distance2(t.x, t.y, n.x, n.y)
};
e.distance2 = function(e, t, n, r) {
var i = e - n,
s = e - n;
return Math.sqrt(i * i + s * s)
};
e.interpolate = function(t, n, r) {
return new e(t.x + (n.x - t.x) * (1 - r), t.y + (n.y - t.y) * (1 - r))
};
e.polar = function(t, n) {
return new e(t * Math.cos(n), t * Math.sin(n))
};
e.prototype = {
toString: function() {
return "[object LPoint(" + this.x + "," + this.y + ")]"
},
length: function() {
return e.distance2(this.x, this.y, 0, 0)
},
add: function(t) {
return e(this.x + t.x, this.y + t.y)
},
clone: function() {
return new e(this.x, this.y)
},
setTo: function(e, t) {
this.x = e, this.y = t
},
copyFrom: function(e) {
this.setTo(e.x, e.y)
},
equals: function(e) {
return this.x == e.x && this.y == e.y
},
normalize: function(e) {
var t = this,
n = e / t.length();
t.x *= n, t.y *= n
},
offset: function(e, t) {
this.x += e;
this.y += t
},
subtract: function(t) {
return new e(this.x - t.x, this.y - t.y)
}
};
return e
}();
var LRectangle = function() {
function e(e, t, n, r) {
var i = this;
i.x = e;
i.y = t;
i.width = n;
i.height = r;
i.setRectangle()
}
e.prototype = {
setRectangle: function() {
var e = this;
e.bottom = e.y + e.height;
e.right = e.x + e.width;
e.left = e.x;
e.top = e.y
},
clone: function() {
var t = this;
return new e(t.x, t.y, t.width, t.height)
},
contains: function(e, t) {
var n = this;
return e >= n.x && e <= n.right && t >= n.y && t <= n.bottom
},
containsRect: function(e) {
var t = this;
return e.x >= t.x && e.right <= t.right && e.y >= t.y && e.bottom <= t.bottom
},
equals: function(e) {
var t = this;
return e.x == t.x && e.width == t.width && e.y == t.y && e.height == t.height
},
inflate: function(e, t) {
var n = this;
n.width += e;
n.height += t;
n.setRectangle()
},
intersection: function(t) {
var n = this;
var r = n.x > t.x ? n.x : t.x;
var i = n.y > t.y ? n.y : t.y;
var s = n.right > t.right ? t.right : n.right;
var o = n.bottom > t.bottom ? t.bottom : n.bottom;
if (r <= s && i <= o) {
return new e(r, i, s, o)
} else {
return new e(0, 0, 0, 0)
}
},
intersects: function(e) {
var t = this;
var n = t.x > e.x ? t.x : e.x;
var r = t.y > e.y ? t.y : e.y;
var i = t.right > e.right ? e.right : t.right;
var s = t.bottom > e.bottom ? e.bottom : t.bottom;
return n <= i && r <= s
},
isEmpty: function() {
var e = this;
return e.x == 0 && e.y == 0 && e.width == 0 && e.height == 0
},
offset: function(e, t) {
var n = this;
n.x += e;
n.y += t;
n.setRectangle()
},
setEmpty: function() {
var e = this;
e.x = 0;
e.y = 0;
e.width = 0;
e.height = 0;
e.setRectangle()
},
setTo: function(e, t, n, r) {
var i = this;
i.x = e;
i.y = t;
i.width = n;
i.height = r;
i.setRectangle()
},
toString: function() {
var e = this;
return "[object LRectangle(" + e.x + "," + e.y + "," + e.width + "," + e.height + ")]"
},
union: function(t) {
var n = this;
return new e(n.x > t.x ? t.x : n.x, n.y > t.y ? t.y : n.y, n.right > t.right ? n.right : t.right, n.bottom > t.bottom ? n.bottom : t.bottom)
}
};
return e
}();
var LGraphics = function() {
function e() {
var e = this;
LExtends(e, LObject, []);
e.type = "LGraphics";
e.color = "#000000";
e.alpha = 1;
e.bitmap = null;
e.setList = new Array;
e.showList = new Array
}
var t = {
ll_show: function() {
var e = this,
t, n = e.setList.length;
if (n == 0) {
return
}
for (t = 0; t < n; t++) {
e.setList[t]()
}
},
clone: function() {
var t = this,
n = new e,
r, i, s;
n.color = t.color;
n.alpha = t.alpha;
n.bitmap = t.bitmap;
for (r = 0, i = t.setList.length; r < i; r++) {
s = t.setList[r];
n.setList.push(s)
}
for (r = 0, i = t.showList.length; r < i; r++) {
s = t.showList[r];
n.showList.push(s)
}
return n
},
lineCap: function(e) {
var t = this;
t.setList.push(function() {
LGlobal.canvas.lineCap = e
})
},
lineJoin: function(e) {
var t = this;
t.setList.push(function() {
LGlobal.canvas.lineJoin = e
})
},
lineWidth: function(e) {
var t = this;
t.setList.push(function() {
LGlobal.canvas.lineWidth = e
})
},
strokeStyle: function(e) {
var t = this;
t.setList.push(function() {
LGlobal.canvas.strokeStyle = e
})
},
stroke: function() {
var e = this;
e.setList.push(function() {
LGlobal.canvas.stroke()
})
},
beginPath: function() {
var e = this;
e.setList.push(function() {
LGlobal.canvas.beginPath()
})
},
closePath: function() {
var e = this;
e.setList.push(function() {
LGlobal.canvas.closePath()
})
},
moveTo: function(e, t) {
var n = this;
n.setList.push(function() {
LGlobal.canvas.moveTo(e, t)
});
n.showList.push({
type: LShape.POINT,
arg: [e, t]
})
},
lineTo: function(e, t) {
var n = this;
n.setList.push(function() {
LGlobal.canvas.lineTo(e, t)
});
n.showList.push({
type: LShape.POINT,
arg: [e, t]
})
},
rect: function(e, t, n, r) {
var i = this;
i.setList.push(function() {
LGlobal.canvas.rect(e, t, n, r)
});
i.showList.push({
type: LShape.RECT,
arg: [e, t, n, r]
})
},
fillStyle: function(e) {
var t = this;
t.setList.push(function() {
LGlobal.canvas.fillStyle = e
})
},
fill: function() {
var e = this;
e.setList.push(function() {
LGlobal.canvas.fill()
})
},
arc: function(e, t, n, r, i, s) {
var o = this;
o.setList.push(function() {
LGlobal.canvas.arc(e, t, n, r, i, s)
});
o.showList.push({
type: LShape.ARC,
arg: r
})
},
lineStyle: function(e, t) {
var n = this,
r;
if (t == null) {
t = n.color
}
n.color = t;
n.setList.push(function() {
r = LGlobal.canvas;
r.lineWidth = e;
r.strokeStyle = t
})
},
clear: function() {
var e = this;
e.bitmap = null;
e.setList.length = 0;
e.showList.length = 0
},
beginBitmapFill: function(e) {
var t = this;
t.setList.push(function() {
t.bitmap = e
})
},
drawEllipse: function(e, t, n, r, i) {
var s = this;
s.setList.push(function() {
var o, u, a, f, l, c, h, p, d, v, m, g;
o = LGlobal.canvas;
o.beginPath();
c = .5522848;
u = n[0];
a = n[1];
f = n[2];
l = n[3];
h = f / 2 * c;
p = l / 2 * c;
d = u + f;
v = a + l;
m = u + f / 2;
g = a + l / 2;
o.moveTo(u, g);
o.bezierCurveTo(u, g - p, m - h, a, m, a);
o.bezierCurveTo(m + h, a, d, g - p, d, g);
o.bezierCurveTo(d, g + p, m + h, v, m, v);
o.bezierCurveTo(m - h, v, u, g + p, u, g);
if (s.bitmap) {
o.save();
o.clip();
o.drawImage(s.bitmap.image, s.bitmap.x, s.bitmap.y, s.bitmap.width, s.bitmap.height, 0, 0, s.bitmap.width, s.bitmap.height);
o.restore();
s.bitmap = null;
return
}
if (r) {
o.fillStyle = i;
o.fill()
}
if (e > 0) {
o.lineWidth = e;
o.strokeStyle = t;
o.stroke()
}
});
s.showList.push({
type: LShape.RECT,
arg: n
})
},
drawArc: function(e, t, n, r, i) {
var s = this;
s.setList.push(function() {
var o = LGlobal.canvas;
o.beginPath();
if (n.length > 6 && n[6]) {
o.moveTo(n[0], n[1])
}
o.arc(n[0], n[1], n[2], n[3], n[4], n[5]);
if (n.length > 6 && n[6]) {
o.lineTo(n[0], n[1])
}
if (s.bitmap) {
o.save();
o.clip();
o.drawImage(s.bitmap.image, s.bitmap.x, s.bitmap.y, s.bitmap.width, s.bitmap.height, 0, 0, s.bitmap.width, s.bitmap.height);
o.restore();
s.bitmap = null;
return
}
if (r) {
o.fillStyle = i;
o.fill()
}
if (e > 0) {
o.lineWidth = e;
o.strokeStyle = t;
o.stroke()
}
});
s.showList.push({
type: LShape.ARC,
arg: n
})
},
drawRect: function(e, t, n, r, i) {
var s = this;
s.setList.push(function() {
var o = LGlobal.canvas;
o.beginPath();
o.rect(n[0], n[1], n[2], n[3]);
o.closePath();
if (s.bitmap) {
o.save();
o.clip();
o.drawImage(s.bitmap.image, s.bitmap.x, s.bitmap.y, s.bitmap.width, s.bitmap.height, 0, 0, s.bitmap.width, s.bitmap.height);
o.restore();
s.bitmap = null;
return
}
if (r) {
o.fillStyle = i;
o.fill()
}
if (e > 0) {
o.lineWidth = e;
o.strokeStyle = t;
o.stroke()
}
});
s.showList.push({
type: LShape.RECT,
arg: n
})
},
drawRoundRect: function(e, t, n, r, i) {
var s = this;
s.setList.push(function() {
var o = LGlobal.canvas;
o.beginPath();
o.moveTo(n[0] + n[4], n[1]);
o.lineTo(n[0] + n[2] - n[4], n[1]);
o.arcTo(n[0] + n[2], n[1], n[0] + n[2], n[1] + n[4], n[4]);
o.lineTo(n[0] + n[2], n[1] + n[3] - n[4]);
o.arcTo(n[0] + n[2], n[1] + n[3], n[0] + n[2] - n[4], n[1] + n[3], n[4]);
o.lineTo(n[0] + n[4], n[1] + n[3]);
o.arcTo(n[0], n[1] + n[3], n[0], n[1] + n[3] - n[4], n[4]);
o.lineTo(n[0], n[1] + n[4]);
o.arcTo(n[0], n[1], n[0] + n[4], n[1], n[4]);
o.closePath();
if (s.bitmap) {
o.save();
o.clip();
o.drawImage(s.bitmap.image, 0, 0, s.bitmap.width, s.bitmap.height, 0, 0, s.bitmap.width, s.bitmap.height);
o.restore();
s.bitmap = null;
return
}
if (r) {
o.fillStyle = i;
o.fill()
}
if (e > 0) {
o.lineWidth = e;
o.strokeStyle = t;
o.stroke()
}
});
s.showList.push({
type: LShape.RECT,
arg: n
})
},
drawVertices: function(e, t, n, r, i) {
var s = this;
if (n.length < 3) {
return
}
s.setList.push(function() {
var o = LGlobal.canvas;
o.beginPath();
o.moveTo(n[0][0], n[0][1]);
var u, a = n.length,
f;
for (u = 1; u < a; u++) {
f = n[u];
o.lineTo(f[0], f[1])
}
o.lineTo(n[0][0], n[0][1]);
o.closePath();
if (s.bitmap) {
o.save();
o.clip();
o.drawImage(s.bitmap.image, s.bitmap.x, s.bitmap.y, s.bitmap.width, s.bitmap.height, 0, 0, s.bitmap.width, s.bitmap.height);
o.restore();
s.bitmap = null;
return
}
if (r) {
o.fillStyle = i;
o.fill()
}
if (e > 0) {
o.lineWidth = e;
o.strokeStyle = t;
o.closePath();
o.stroke()
}
});
s.showList.push({
type: LShape.VERTICES,
arg: n
})
},
drawTriangles: function(e, t, n, r, i) {
var s = this;
var o, u, a = t.length,
f;
s.setList.push(function() {
f = LGlobal.canvas;
var h = e,
p, d, v;
for (o = 0, u = 0; o < a; o += 3) {
p = 0;
f.save();
f.beginPath();
f.moveTo(h[t[o] * 2], h[t[o] * 2 + 1]);
f.lineTo(h[t[o + 1] * 2], h[t[o + 1] * 2 + 1]);
f.lineTo(h[t[o + 2] * 2], h[t[o + 2] * 2 + 1]);
f.lineTo(h[t[o] * 2], h[t[o] * 2 + 1]);
f.closePath();
if (r) {
f.lineWidth = r;
f.strokeStyle = i;
f.stroke()
}
f.clip();
if (o % 6 == 0) {
v = -1;
var m = (n[t[o + 1 + u] * 2] - n[t[o + u] * 2]) * s.bitmap.width;
var g = (n[t[o + 2] * 2 + 1] - n[t[o] * 2 + 1]) * s.bitmap.height;
if (u == 0 && m < 0) {
for (d = o + 9; d < a; d += 3) {
if (n[t[o + 2] * 2 + 1] == n[t[d + 2] * 2 + 1]) {
u = d - o;
break
}
}
if (u == 0) {
u = a - o
}
m = (n[t[o + 1 + u] * 2] - n[t[o + u] * 2]) * s.bitmap.width
}
if (o + u >= a) {
m = (n[t[o + u - a] * 2] - n[t[o + 1] * 2]) * s.bitmap.width;
v = n[t[o] * 2] == 1 ? 0 : s.bitmap.width * n[t[o] * 2] + m;
if (v > s.bitmap.width) {
v -= s.bitmap.width
}
} else {
v = s.bitmap.width * n[t[o + u] * 2]
}
sh = s.bitmap.height * n[t[o] * 2 + 1];
if (g < 0) {
g = (n[t[o + 2 - (o > 0 ? 6 : -6)] * 2 + 1] - n[t[o - (o > 0 ? 6 : -6)] * 2 + 1]) * s.bitmap.height;
sh = 0
}
var y = (h[t[o + 1] * 2] - h[t[o] * 2]) / m;
var b = (h[t[o + 1] * 2 + 1] - h[t[o] * 2 + 1]) / m;
var w = (h[t[o + 2] * 2] - h[t[o] * 2]) / g;
var E = (h[t[o + 2] * 2 + 1] - h[t[o] * 2 + 1]) / g;
f.transform(y, b, w, E, h[t[o] * 2], h[t[o] * 2 + 1]);
f.drawImage(s.bitmap.image, s.bitmap.x + v, s.bitmap.y + sh, m, g, 0, 0, m, g)
} else {
var m = (n[t[o + 2 + u] * 2] - n[t[o + 1 + u] * 2]) * s.bitmap.width;
var g = (n[t[o + 2] * 2 + 1] - n[t[o] * 2 + 1]) * s.bitmap.height;
if (u == 0 && m < 0) {
for (d = o + 9; d < a; d += 3) {
if (n[t[o + 2] * 2 + 1] == n[t[d + 2] * 2 + 1]) {
u = d - o;
break
}
}
if (u == 0) {
u = a - o
}
m = (n[t[o + 2 + u] * 2] - n[t[o + 1 + u] * 2]) * s.bitmap.width
}
if (o + 1 + u >= a) {
m = (n[t[o + 1 + u - a] * 2] - n[t[o + 2] * 2]) * s.bitmap.width;
v = n[t[o + 1] * 2] == 1 ? 0 : s.bitmap.width * n[t[o + 1] * 2] + m;
if (v > s.bitmap.width) {
v -= s.bitmap.width
}
} else {
v = s.bitmap.width * n[t[o + 1 + u] * 2]
}
sh = s.bitmap.height * n[t[o] * 2 + 1];
if (g < 0) {
g = (n[t[o + 2 - (o > 0 ? 6 : -6)] * 2 + 1] - n[t[o - (o > 0 ? 6 : -6)] * 2 + 1]) * s.bitmap.height;
sh = 0
}
var y = (h[t[o + 2] * 2] - h[t[o + 1] * 2]) / m;
var b = (h[t[o + 2] * 2 + 1] - h[t[o + 1] * 2 + 1]) / m;
var w = (h[t[o + 2] * 2] - h[t[o] * 2]) / g;
var E = (h[t[o + 2] * 2 + 1] - h[t[o] * 2 + 1]) / g;
f.transform(y, b, w, E, h[t[o + 1] * 2], h[t[o + 1] * 2 + 1]);
f.drawImage(s.bitmap.image, s.bitmap.x + v, s.bitmap.y + sh, m, g, 0, -g, m, g)
}
f.restore()
}
})
},
drawLine: function(e, t, n) {
var r = this;
r.setList.push(function() {
var r = LGlobal.canvas;
r.beginPath();
r.moveTo(n[0], n[1]);
r.lineTo(n[2], n[3]);
r.lineWidth = e;
r.strokeStyle = t;
r.closePath();
r.stroke()
});
r.showList.push({
type: LShape.LINE,
arg: n
})
},
add: function(e) {
this.setList.push(e)
},
ismouseon: function(e, t) {
var n = this;
if (e == null || e == UNDEFINED || n.showList.length == 0 || !n.parent) {
return false
}
return n.parent.ismouseonShapes(n.showList, e.offsetX, e.offsetY)
},
getWidth: function() {
var e = this,
t, n, r, i, s, o, u;
for (t = 0, o = e.showList.length; t < o; t++) {
if (e.showList[t].type == LShape.RECT) {
if (r > e.showList[t].arg[0] || typeof r == UNDEFINED) {
r = e.showList[t].arg[0]
}
if (i < e.showList[t].arg[0] + e.showList[t].arg[2] || typeof i == UNDEFINED) {
i = e.showList[t].arg[0] + e.showList[t].arg[2]
}
} else if (e.showList[t].type == LShape.ARC) {
if (r > e.showList[t].arg[0] - e.showList[t].arg[2] || typeof r == UNDEFINED) {
r = e.showList[t].arg[0] - e.showList[t].arg[2]
}
if (i < e.showList[t].arg[0] + e.showList[t].arg[2] || typeof i == UNDEFINED) {
i = e.showList[t].arg[0] + e.showList[t].arg[2]
}
} else if (e.showList[t].type == LShape.VERTICES) {
for (n = 0, u = e.showList[t].arg.length; n < u; n++) {
s = e.showList[t].arg[n];
if (r > s[0] || typeof r == UNDEFINED) {
r = s[0]
}
if (i < s[0] || typeof i == UNDEFINED) {
i = s[0]
}
}
} else if (e.showList[t].type == LShape.LINE) {
if (r > e.showList[t].arg[0] || typeof r == UNDEFINED) {
r = e.showList[t].arg[0]
}
if (r > e.showList[t].arg[2] || typeof r == UNDEFINED) {
r = e.showList[t].arg[2]
}
if (i < e.showList[t].arg[0] || typeof i == UNDEFINED) {
i = e.showList[t].arg[0]
}
if (i < e.showList[t].arg[2] || typeof i == UNDEFINED) {
i = e.showList[t].arg[2]
}
} else if (e.showList[t].type == LShape.POINT) {
if (r > e.showList[t].arg[0] || typeof r == UNDEFINED) {
r = e.showList[t].arg[0]
}
if (i < e.showList[t].arg[0] || typeof i == UNDEFINED) {
i = e.showList[t].arg[0]
}
}
}
if (typeof r == UNDEFINED) {
r = i = 0
}
e.left = r;
if (o > 0 && i == r) {
i = r + 1
}
return i - r
},
getHeight: function() {
var e = this,
t = null,
n = null,
r, i, s, o, u;
for (t = 0, r = e.showList.length; t < r; t++) {
if (e.showList[t].type == LShape.RECT) {
if (s > e.showList[t].arg[1] || typeof s == UNDEFINED) {
s = e.showList[t].arg[1]
}
if (o < e.showList[t].arg[1] + e.showList[t].arg[3] || typeof o == UNDEFINED) {
o = e.showList[t].arg[1] + e.showList[t].arg[3]
}
} else if (e.showList[t].type == LShape.ARC) {
if (s > e.showList[t].arg[1] - e.showList[t].arg[2] || typeof s == UNDEFINED) {
s = e.showList[t].arg[1] - e.showList[t].arg[2]
}
if (o < e.showList[t].arg[1] + e.showList[t].arg[2] || typeof o == UNDEFINED) {
o = e.showList[t].arg[1] + e.showList[t].arg[2]
}
} else if (e.showList[t].type == LShape.VERTICES) {
for (n = 0, i = e.showList[t].arg.length; n < i; n++) {
u = e.showList[t].arg[n];
if (s > u[1] || typeof s == UNDEFINED) {
s = u[1]
}
if (o < u[1] || typeof o == UNDEFINED) {
o = u[1]
}
}
} else if (e.showList[t].type == LShape.LINE) {
if (s > e.showList[t].arg[1] || typeof s == UNDEFINED) {
s = e.showList[t].arg[1]
}
if (s > e.showList[t].arg[3] || typeof s == UNDEFINED) {
s = e.showList[t].arg[3]
}
if (o < e.showList[t].arg[1] || typeof o == UNDEFINED) {
o = e.showList[t].arg[1]
}
if (o < e.showList[t].arg[3] || typeof o == UNDEFINED) {
o = e.showList[t].arg[3]
}
} else if (e.showList[t].type == LShape.POINT) {
if (s > e.showList[t].arg[1] || typeof s == UNDEFINED) {
s = e.showList[t].arg[1]
}
if (o < e.showList[t].arg[1] || typeof o == UNDEFINED) {
o = e.showList[t].arg[1]
}
}
}
if (typeof s == UNDEFINED) {
s = o = 0
}
e.top = s;
if (r > 0 && o == s) {
o = s + 1
}
return o - s
},
startX: function() {
var e = this;
e.getWidth();
return e.left
},
startY: function() {
var e = this;
e.getHeight();
return e.top
}
};
for (var n in t) {
e.prototype[n] = t[n]
}
return e
}();
var LShape = function() {
function e() {
var e = this;
LExtends(e, LInteractiveObject, []);
e.type = "LShape";
e.graphics = new LGraphics;
e.graphics.parent = e
}
e.POINT = "point";
e.LINE = "line";
e.ARC = "arc";
e.RECT = "rect";
e.VERTICES = "vertices";
var t = {
_ll_show: function(e) {
var t = this;
t.graphics.ll_show()
},
getWidth: function(e) {
var t = this,
n, r, i = t.graphics.startX(),
s = i + t.graphics.getWidth();
if (e && t.mask) {
n = t.mask._startX ? t.mask._startX() : t.mask.startX();
r = t.mask.getWidth();
if (i < n) {
i = n
}
if (s > n + r) {
s = n + r
}
}
t.ll_left = t.x + i;
t.ll_right = t.x + s;
return (s - i) * t.scaleX
},
getHeight: function(e) {
var t = this,
n, r, i = t.graphics.startY(),
s = i + t.graphics.getHeight();
if (e && t.mask) {
n = t.mask._startY ? t.mask._startY() : t.mask.startY();
r = t.mask.getHeight();
if (i < n) {
i = n
}
if (s > n + r) {
s = n + r
}
}
t.ll_top = t.y + i;
t.ll_bottom = t.y + s;
return (s - i) * t.scaleY
},
_startX: function() {
var e = this;
e.getWidth();
return e.ll_left
},
startX: function() {
var e = this;
return e._startX() * e.scaleX
},
_startY: function() {
var e = this;
e.getHeight();
return e.ll_top
},
startY: function() {
var e = this;
return e._startY() * e.scaleY
},
clone: function() {
var t = this,
n = new e,
r, i;
n.copyProperty(t);
n.graphics = t.graphics.clone();
n.graphics.parent = n;
return n
},
ismouseon: function(e, t) {
var n = this,
r = false,
i;
if (!n.visible || e == null) {
return false
}
if (n.mask) {
if (!n.mask.parent) {
n.mask.parent = n.parent
}
if (!n.mask.ismouseon(e, t)) {
return false
}
}
i = {
x: n.x * t.scaleX + t.x,
y: n.y * t.scaleY + t.y,
scaleX: t.scaleX * n.scaleX,
scaleY: t.scaleY * n.scaleY
};
if (n.graphics) {
r = n.graphics.ismouseon(e, i)
}
return r
},
die: function() {
var e = this;
e.graphics.clear()
}
};
for (var n in t) {
e.prototype[n] = t[n]
}
return e
}();
var LSprite = function() {
function e() {
var e = this;
LExtends(e, LDisplayObjectContainer, []);
e.type = "LSprite";
e.rotatex;
e.rotatey;
e.graphics = new LGraphics;
e.graphics.parent = e;
e.box2dBody = null;
e.shapes = new Array
}
var t = {
setRotate: function(e) {
var t = this;
if (t.box2dBody) {
t.box2dBody.SetAngle(e)
} else {
t.rotate = e
}
},
_rotateReady: function() {
var e = this;
if (e.box2dBody) {
if (typeof e.rotatex == UNDEFINED) {
e.getRotateXY()
}
e.x = e.box2dBody.GetPosition().x * LGlobal.box2d.drawScale - e.parent.x - e.rotatex;
e.y = e.box2dBody.GetPosition().y * LGlobal.box2d.drawScale - e.parent.y - e.rotatey;
e.rotate = e.box2dBody.GetAngle()
}
},
_ll_show: function(e) {
var t = this;
t.graphics.ll_show();
LGlobal.show(t.childList);
t._ll_debugShape()
},
startDrag: function(e) {
var t = this,
n, r;
if (t.ll_dragStart) {
return
}
t.ll_touchPointID = e;
t.ll_dragStartX = t.x;
t.ll_dragStartY = t.y;
t.ll_dragMX = mouseX;
t.ll_dragMY = mouseY;
t.ll_dragStart = true;
LGlobal.dragList.push(t)
},
stopDrag: function() {
var e = this,
t, n;
for (t = 0, n = LGlobal.dragList.length; t < n; t++) {
if (e.objectIndex == LGlobal.dragList[t].objectIndex) {
e.ll_dragStart = false;
LGlobal.dragList.splice(t, 1);
break
}
}
},
getRotateXY: function(e, t) {
var n = this;
if (!e || !t) {
e = n.getWidth();
t = n.getHeight()
}
n.rotatex = e / 2;
n.rotatey = t / 2
},
getWidth: function(e) {
var t = this,
n, r, i, s, o, u, a, f = t.graphics.startX(),
l = f + t.graphics.getWidth();
for (n = 0, r = t.childList.length; n < r; n++) {
i = t.childList[n];
if (typeof i.visible == UNDEFINED || !i.visible) {
continue
}
s = i.x;
if (typeof i._startX == "function") {
s = i._startX()
}
o = s + i.getWidth(e);
if (s < f) {
f = s
}
if (o > l) {
l = o
}
}
if (e && t.mask) {
u = t.mask._startX ? t.mask._startX() : t.mask.startX();
a = t.mask.getWidth();
if (f < u) {
f = u
}
if (l > u + a) {
l = u + a
}
}
t.ll_left = t.x + f;
t.ll_right = t.x + l;
return (l - f) * t.scaleX
},
getHeight: function(e) {
var t = this,
n, r, i, s, o, u, a, f = t.graphics.startY(),
l = f + t.graphics.getHeight();
for (n = 0, r = t.childList.length; n < r; n++) {
i = t.childList[n];
if (typeof i.visible == UNDEFINED || !i.visible) {
continue
}
s = i.y;
if (typeof i._startY == "function") {
s = i._startY()
}
o = s + i.getHeight(e);
if (s < f) {
f = s
}
if (o > l) {
l = o
}
}
if (e && t.mask) {
u = t.mask._startY ? t.mask._startY() : t.mask.startY();
a = t.mask.getHeight();
if (f < u) {
f = u
}
if (l > u + a) {
l = u + a
}
}
t.ll_top = t.y + f;
t.ll_bottom = t.y + l;
return (l - f) * t.scaleY
},
_startX: function() {
var e = this;
e.getWidth();
return e.ll_left
},
startX: function() {
var e = this;
return e._startX() * e.scaleX
},
_startY: function() {
var e = this;
e.getHeight();
return e.ll_top
},
startY: function() {
var e = this;
return e._startY() * e.scaleY
},
_ll_loopframe: function() {
this.dispatchEvent(LEvent.ENTER_FRAME)
},
clone: function() {
var t = this,
n = new e,
r, i, s, o;
n.copyProperty(t);
n.graphics = t.graphics.clone();
n.graphics.parent = n;
n.childList.length = 0;
for (s = 0, o = t.childList.length; s < o; s++) {
r = t.childList[s];
if (r.clone) {
i = r.clone();
i.parent = n;
n.childList.push(i)
}
}
return n
},
_mevent: function(e) {
var t = this,
n;
for (n = 0; n < t.mouseList.length; n++) {
var r = t.mouseList[n];
if (r.type == e) {
return true
}
}
return false
},
ll_dispatchMouseEvent: function(e, t, r, i, s) {
var o = this;
for (n = 0; n < o.mouseList.length; n++) {
var u = o.mouseList[n];
if (u.type == e) {
t.selfX = (i - (o.x * r.scaleX + r.x)) / (r.scaleX * o.scaleX);
t.selfY = (s - (o.y * r.scaleY + r.y)) / (r.scaleY * o.scaleY);
t.currentTarget = t.clickTarget = o;
if (!t.target) {
t.target = o
}
u.listener(t, o)
}
}
},
ll_mouseout: function(e, t, n, r, i) {
var s = this;
if (t == LMouseEvent.MOUSE_MOVE && s.ll_mousein) {
s.ll_mousein = false;
if (s._mevent(LMouseEvent.MOUSE_OUT)) {
s.ll_dispatchMouseEvent(LMouseEvent.MOUSE_OUT, e, n, r, i)
}
if (s.mouseChildren) {
for (var o = s.childList.length - 1; o >= 0; o--) {
if (s.childList[o].mouseEvent && s.childList[o].ll_mouseout) {
s.childList[o].ll_mouseout(e, t, n, r, i)
}
}
}
}
},
mouseEvent: function(e, t, n) {
if (!e) {
return false
}
var r = this,
i, s, o = e.offsetX,
u = e.offsetY,
a, f;
if (!r.mouseEnabled || !r.visible) {
return false
}
if (n == null) {
n = {
x: 0,
y: 0,
scaleX: 1,
scaleY: 1
}
}
a = r.ismouseon(e, n);
if (a) {
if (t == LMouseEvent.MOUSE_MOVE && !r.ll_mousein) {
r.ll_mousein = true;
if (r._mevent(LMouseEvent.MOUSE_OVER)) {
r.ll_dispatchMouseEvent(LMouseEvent.MOUSE_OVER, e, n, o, u)
}
}
if (r.mouseChildren) {
f = {
x: r.x * n.scaleX + n.x,
y: r.y * n.scaleY + n.y,
scaleX: n.scaleX * r.scaleX,
scaleY: n.scaleY * r.scaleY
};
for (s = r.childList.length - 1; s >= 0; s--) {
if (r.childList[s].mouseEvent) {
i = r.childList[s].mouseEvent(e, t, f);
if (i) {
e.target = r.childList[s];
if (t != LMouseEvent.MOUSE_MOVE) {
break
}
}
}
}
if (r._mevent(t)) {
r.ll_dispatchMouseEvent(t, e, n, o, u)
}
}
return true
} else {
r.ll_mouseout(e, t, n, o, u)
}
return false
},
hitTestPoint: function(e, t) {
var n = this,
r = n.shapes;
if (!r || r.length == 0) {
n.getWidth();
n.getHeight();
r = [{
type: LShape.RECT,
arg: [n.ll_left - n.x, n.ll_top - n.y, n.ll_right - n.ll_left, n.ll_bottom - n.ll_top]
}]
}
return n.ismouseonShapes(r, e, t)
},
hitTestObject: function(e) {
var t = this,
n = t.shapes,
r = e.shapes,
i, s, o, u, a, f, l, c;
if (!n || n.length == 0) {
t.getWidth();
t.getHeight();
n = [{
type: LShape.RECT,
arg: [t.ll_left - t.x, t.ll_top - t.y, t.ll_right - t.ll_left, t.ll_bottom - t.ll_top]
}]
}
if (!r || r.length == 0) {
e.getWidth();
e.getHeight();
r = [{
type: LShape.RECT,
arg: [e.ll_left - e.x, e.ll_top - e.y, e.ll_right - e.ll_left, e.ll_bottom - e.ll_top]
}]
}
i = t.getRootMatrix();
s = e.getRootMatrix();
for (o = n.length - 1; o >= 0; o--) {
u = n[o];
c = t._changeShape(u.type, u.arg, i);
for (a = r.length - 1; a >= 0; a--) {
f = r[a];
l = e._changeShape(f.type, f.arg, s);
if (u.type == LShape.VERTICES || u.type == LShape.RECT) {
if (f.type == LShape.VERTICES || f.type == LShape.RECT) {
if (LGlobal.hitTestPolygon(c, l)) {
return true
}
} else if (f.type == LShape.ARC) {
if (LGlobal.hitTestPolygonArc(c, l)) {
return true
}
}
} else {
if (f.type == LShape.VERTICES || f.type == LShape.RECT) {
if (LGlobal.hitTestPolygonArc(l, c)) {
return true
}
} else if (f.type == LShape.ARC) {
if (Math.sqrt((c[0] - l[0]) * (c[0] - l[0]) + (c[1] - l[1]) * (c[1] - l[1])) < c[2] + l[2]) {
return true
}
}
}
}
}
return false
},
addShape: function(e, t) {
var n = this;
if (e == LShape.VERTICES && t.length < 3) {
return
}
n.shapes.push({
type: e,
arg: t
})
},
clearShape: function() {
var e = this;
e.shapes.length = 0
},
_ll_debugShape: function() {
var e = this,
t, n, r, i, s, o, u;
if (!LGlobal.traceDebug || e.shapes.length == 0) {
return
}
for (t = 0, n = e.shapes.length; t < n; t++) {
r = e.shapes[t];
i = LGlobal.canvas;
s = r.arg;
i.beginPath();
if (r.type == LShape.RECT) {
i.rect(s[0], s[1], s[2], s[3])
} else if (r.type == LShape.ARC) {
i.arc(s[0], s[1], s[2], 0, 2 * Math.PI)
} else if (r.type == LShape.VERTICES) {
i.moveTo(s[0][0], s[0][1]);
for (o = 1, u = s.length; o < u; o++) {
i.lineTo(s[o][0], s[o][1])
}
i.lineTo(s[0][0], s[0][1])
}
i.closePath();
i.strokeStyle = "#00FF00";
i.stroke()
}
},
ismouseon: function(e, t) {
var n = this;
if (!n.visible || e == null) {
return false
}
if (n.mask) {
if (!n.mask.parent) {
n.mask.parent = n.parent
}
if (!n.mask.ismouseon(e, t)) {
return false
}
}
if (n.shapes && n.shapes.length > 0) {
return n.ismouseonShapes(n.shapes, e.offsetX, e.offsetY)
}
var r, i = false,
s = n.childList,
o = {
x: n.x * t.scaleX + t.x,
y: n.y * t.scaleY + t.y,
scaleX: t.scaleX * n.scaleX,
scaleY: t.scaleY * n.scaleY
};
if (n.graphics) {
i = n.graphics.ismouseon(e, o)
}
if (!i) {
for (r = s.length - 1; r >= 0; r--) {
if (s[r].ismouseon) {
i = s[r].ismouseon(e, o)
}
if (i) {
e.target = n.childList[r];
break
}
}
}
return i
},
die: function() {
var e = this,
t, n, r;
e.graphics.clear();
e.removeAllEventListener();
e.stopDrag();
if (e.box2dBody) {
e.clearBody()
}
for (t = 0, n = e.childList, r = n.length; t < r; t++) {
if (n[t].die) {
n[t].die()
}
}
}
};
for (var n in t) {
e.prototype[n] = t[n]
}
return e
}();
var LButton = function() {
function e(t, n, r, i) {
var s = this;
LExtends(s, LSprite, []);
s.type = "LButton";
s.addChild(t);
if (!n) {
n = t
} else {
s.addChild(n)
} if (!r) {
r = n
} else {
s.addChild(r)
} if (!i) {
i = t
} else {
s.addChild(i)
}
s.upState = s.bitmap_up = t;
s.overState = s.bitmap_over = n;
s.downState = r;
s.disableState = i;
s._ll_down_sx = s.downState.scaleX;
s._ll_down_sy = s.downState.scaleY;
s.overState.visible = false;
s.downState.visible = false;
s.upState.visible = true;
s.buttonMode = true;
s.staticMode = false;
s._ll_cursorEnabled = true;
s.setState(e.STATE_ENABLE);
if (LMouseEventContainer.container[LMouseEvent.MOUSE_MOVE]) {
LMouseEventContainer.pushButton(s)
}
s.addEventListener(LMouseEvent.MOUSE_DOWN, s.ll_modeDown)
}
e.STATE_DISABLE = "disable";
e.STATE_ENABLE = "enable";
var t = {
setState: function(t) {
var n = this;
if (t == e.STATE_DISABLE) {
n.upState.visible = false;
n.overState.visible = false;
n.downState.visible = false;
n.disableState.visible = true;
n.mouseEnabled = false
} else if (t == e.STATE_ENABLE) {
n.overState.visible = false;
n.downState.visible = false;
n.disableState.visible = false;
n.upState.visible = true;
n.mouseEnabled = true
} else {
return
}
n.state = t
},
ll_mouseout: function(e, t, n, r, i) {
var s = this;
if (!s.ll_mousein) {
return
}
e.clickTarget = s;
s.ll_modeOut(e);
s.ll_mousein = false
},
mouseEvent: function(e, t, n) {
if (!e) {
return false
}
var r = this;
if (t == LMouseEvent.MOUSE_MOVE && r.ll_button_mode) {
r.ll_button_mode(e)
}
return this.callParent("mouseEvent", arguments)
},
ll_button_mode: function(e) {
var t = this;
if (!t.visible) {
return
}
e.clickTarget = t;
if (t.hitTestPoint(e.offsetX, e.offsetY)) {
t.ll_modeOver(e)
} else {
t.ll_modeOut(e)
}
},
ll_modeDown: function(t) {
var n = t.clickTarget,
r, i, s, o, u, a, f, l, c;
if (!n.buttonMode || n.tween) {
return
}
if (n.state == e.STATE_DISABLE) {
n.upState.visible = false;
n.overState.visible = false;
n.downState.visible = false;
n.disableState.visible = true;
return
}
n.upState.visible = false;
n.overState.visible = false;
n.downState.visible = true;
n._tweenOver = n.ll_modeOver;
c = function(e) {
var t = e.parent;
delete t.tween;
t._tweenOver({
clickTarget: t
});
delete t._tweenOver
};
if (n.staticMode) {
n.tween = LTweenLiteTimeline.to(n.downState, .3, {}).to(n.downState, .1, {
onComplete: c
})
} else {
r = n.downState.getWidth();
i = n.downState.getHeight();
s = r * 1.1;
o = i * 1.1;
u = n.downState.x;
a = n.downState.y;
f = u + (r - s) * .5;
l = a + (i - o) * .5;
n.tween = LTweenLiteTimeline.to(n.downState, .3, {
x: f,
y: l,
scaleX: n._ll_down_sx * 1.1,
scaleY: n._ll_down_sy * 1.1,
ease: Quart.easeOut
}).to(n.downState, .1, {
x: u,
y: a,
scaleX: n._ll_down_sx,
scaleY: n._ll_down_sy,
ease: Quart.easeOut,
onComplete: c
})
}
},
ll_modeOver: function(t) {
var n = t.clickTarget;
if (!n.buttonMode) {
return
}
if (n.tween) {
n._tweenOver = n.ll_modeOver;
return
}
if (n.state == e.STATE_DISABLE) {
n.upState.visible = false;
n.overState.visible = false;
n.downState.visible = false;
n.disableState.visible = true;
return
}
n.upState.visible = false;
n.downState.visible = false;
n.overState.visible = true;
if (LGlobal.os == OS_PC && n._ll_cursorEnabled && n.parent) {
LGlobal.cursor = "pointer"
}
},
ll_modeOut: function(t) {
var n = t.clickTarget;
if (!n.buttonMode) {
return
}
if (n.tween) {
n._tweenOver = n.ll_modeOut;
return
}
if (n.state == e.STATE_DISABLE) {
n.upState.visible = false;
n.overState.visible = false;
n.downState.visible = false;
n.disableState.visible = true;
return
}
n.overState.visible = false;
n.downState.visible = false;
n.upState.visible = true
},
setCursorEnabled: function(e) {
this._ll_cursorEnabled = e
},
clone: function() {
var t = this;
return new e(t.upState.clone(), t.overState.clone(), t.downState.clone(), t.disableState.clone())
},
die: function() {
var e = this;
if (LMouseEventContainer.container[LMouseEvent.MOUSE_MOVE]) {
LMouseEventContainer.removeButton(e)
}
e.callParent("die", arguments)
}
};
for (var n in t) {
e.prototype[n] = t[n]
}
return e
}();
LBlendMode.SOURCE_OVER = "source-over";
LBlendMode.SOURCE_ATOP = "source-atop";
LBlendMode.SOURCE_IN = "source-in";
LBlendMode.SOURCE_OUT = "source-out";
LBlendMode.DESTINATION_OVER = "destination-over";
LBlendMode.DESTINATION_ATOP = "destination-atop";
LBlendMode.DESTINATION_IN = "destination-in";
LBlendMode.DESTINATION_OUT = "destination-out";
LBlendMode.LIGHTER = "lighter";
LBlendMode.COPY = "copy";
LBlendMode.XOR = "xor";
LBlendMode.NONE = null;
LBlendMode.NORMAL = null;
var LTextFieldType = function() {
throw "LTextFieldType cannot be instantiated"
};
LTextFieldType.INPUT = "input";
LTextFieldType.DYNAMIC = null;
var LTextField = function() {
function e() {
var t = this;
LExtends(t, LInteractiveObject, []);
t.type = "LTextField";
t.texttype = null;
t.text = "";
t.font = "Arial";
t.size = "11";
t.color = "#000000";
t.weight = "normal";
t.textAlign = "left";
t.textBaseline = "top";
t.heightMode = e.HEIGHT_MODE_BOTTOM;
t.stroke = false;
t.lineWidth = 1;
t.lineColor = "#000000";
t.width = 150;
t.height = t.size;
t.displayAsPassword = false;
t.wordWrap = false;
t.multiline = false;
t.numLines = 1;
t.speed = 0;
t._speedIndex = 100
}
e.HEIGHT_MODE_BOTTOM = "bottom";
e.HEIGHT_MODE_BASELINE = "baseline";
var t = {
_showReady: function(e) {
var t = this;
e.font = t.weight + " " + t.size + "pt " + t.font;
e.textAlign = t.textAlign;
e.textBaseline = t.textBaseline
},
_ll_show: function(e) {
var t = this,
n, r, i, s, o, u, a, f, l, c;
if (t.texttype == LTextFieldType.INPUT) {
t.inputBackLayer.ll_show();
s = t.getRootCoordinate();
if (LGlobal.inputBox.name == "input" + t.objectIndex) {
LGlobal.inputBox.style.marginTop = parseInt(LGlobal.canvasObj.style.marginTop) + ((s.y + t.inputBackLayer.startY()) * parseInt(LGlobal.canvasObj.style.height) / LGlobal.canvasObj.height >>> 0) + "px";
LGlobal.inputBox.style.marginLeft = parseInt(LGlobal.canvasObj.style.marginLeft) + ((s.x + t.inputBackLayer.startX()) * parseInt(LGlobal.canvasObj.style.width) / LGlobal.canvasObj.width >>> 0) + "px"
}
if (LGlobal.inputTextField && LGlobal.inputTextField.objectIndex == t.objectIndex) {
return
}
}
r = t.text;
if (t.displayAsPassword) {
r = "";
for (i = 0, u = t.text.length; i < u; i++) {
r += "*"
}
}
e.fillStyle = t.color;
if (t.stroke) {
e.strokeStyle = t.lineColor;
e.lineWidth = t.lineWidth + 1
}
if (t.wordWrap || t.multiline) {
o = 0, a = 0, f = 0, l = 0;
for (i = 0, u = t.text.length; i < u; i++) {
c = /(?:\r\n|\r|\n|Â¥n)/.exec(r.substr(i, 1));
if (c) {
o = 0;
a = i + 1;
f++
}
if (!c) {
if (t.stroke) {
e.strokeText(r.substr(i, 1), o, f * t.wordHeight)
}
e.fillText(r.substr(i, 1), o, f * t.wordHeight)
}
t.numLines = f;
o = e.measureText(t.text.substr(a, i + 1 - a)).width;
if (t.wordWrap && o + e.measureText(r.substr(i, 1)).width > t.width) {
o = 0;
a = i + 1;
f++
}
}
t.height = (f + 1) * t.wordHeight
} else {
t.numLines = 1;
if (t.stroke) {
e.strokeText(r, 0, 0, e.measureText(r).width)
}
e.fillText(r, 0, 0, e.measureText(r).width)
} if (t.windRunning) {
t._ll_windRun()
}
},
_wordHeight: function(e) {
var t = this;
if (e > 0) {
t.wordHeight = e
} else {
t.wordWrap = false;
t.wordHeight = t.getHeight()
}
t.height = 0
},
setMultiline: function(e, t) {
var n = this;
if (e) {
n._wordHeight(t)
}
n.multiline = e
},
setWordWrap: function(e, t) {
var n = this;
if (e) {
n._wordHeight(t)
}
n.wordWrap = e
},
setType: function(e, t) {
var n = this;
if (n.texttype != e && e == LTextFieldType.INPUT) {
if (t == null || t.type != "LSprite") {
n.inputBackLayer = new LSprite;
n.inputBackLayer.graphics.drawRect(1, "#000000", [0, -n.getHeight() * .4, n.width, n.getHeight() * 1.5])
} else {
n.inputBackLayer = t
}
n.inputBackLayer.parent = n;
if (LMouseEventContainer.container[LMouseEvent.MOUSE_DOWN]) {
LMouseEventContainer.pushInputBox(n)
}
} else {
n.inputBackLayer = null;
LMouseEventContainer.removeInputBox(n)
}
n.texttype = e
},
ismouseon: function(e, t) {
var n = this;
if (!e) {
return false
}
if (!n.visible) {
return false
}
if (!t) {
t = {
x: 0,
y: 0,
scaleX: 1,
scaleY: 1
}
}
if (n.mask) {
if (!n.mask.parent) {
n.mask.parent = n.parent
}
if (!n.mask.ismouseon(e, t)) {
return false
}
}
if (n.inputBackLayer) {
return n.inputBackLayer.ismouseon(e, {
x: n.x * t.scaleX + t.x,
y: n.y * t.scaleY + t.y,
scaleX: t.scaleX * n.scaleX,
scaleY: t.scaleY * n.scaleY
})
}
return n.ismouseonShapes([{
type: LShape.RECT,
arg: [0, 0, n._getWidth(), n._getHeight()]
}], e.offsetX, e.offsetY)
},
clone: function() {
var e = this,
t = new e.constructor;
t.copyProperty(e);
t.texttype = null;
if (e.texttype == LTextFieldType.INPUT) {
t.setType(LTextFieldType.INPUT)
}
return t
},
mouseEvent: function(e, t, n) {
var r = this,
i;
if (r.inputBackLayer == null) {
return
}
i = r.ismouseon(e, n);
if (t != LMouseEvent.MOUSE_DOWN || !i) {
return
}
r.focus()
},
_ll_getValue: function() {
if (LGlobal.inputBox.style.display != NONE) {
LGlobal.inputTextField.text = LGlobal.inputTextBox.value;
LEvent.removeEventListener(LGlobal.inputTextBox, LKeyboardEvent.KEY_DOWN, LGlobal.inputTextField._ll_input);
LGlobal.inputBox.style.display = NONE;
LGlobal.inputTextField.dispatchEvent(LFocusEvent.FOCUS_OUT);
LGlobal.inputTextField = null
}
},
updateInput: function() {
var e = this;
if (e.texttype == LTextFieldType.INPUT && LGlobal.inputTextField.objectIndex == e.objectIndex) {
LGlobal.inputTextBox.value = LGlobal.inputTextField.text
}
},
_ll_input: function(e) {
var t = new LEvent(LTextEvent.TEXT_INPUT);
t.keyCode = e.keyCode;
LGlobal.inputTextField.text = LGlobal.inputTextBox.value;
if (LGlobal.inputTextField.hasEventListener(LTextEvent.TEXT_INPUT)) {
e.returnValue = LGlobal.inputTextField.dispatchEvent(t)
} else {
e.returnValue = true
}
},
focus: function() {
var e = this,
t, n;
if (!e.parent) {
return
}
if (e.texttype != LTextFieldType.INPUT) {
return
}
if (LGlobal.inputTextField && LGlobal.inputTextField.objectIndex != e.objectIndex) {
e._ll_getValue()
}
e.dispatchEvent(LFocusEvent.FOCUS_IN);
t = e.getAbsoluteScale();
LGlobal.inputBox.style.display = "";
LGlobal.inputBox.name = "input" + e.objectIndex;
LGlobal.inputTextField = e;
LGlobal.inputTextareaBoxObj.style.display = NONE;
LGlobal.inputTextBoxObj.style.display = NONE;
LGlobal.passwordBoxObj.style.display = NONE;
if (e.displayAsPassword) {
LGlobal.inputTextBox = LGlobal.passwordBoxObj
} else if (e.multiline) {
LGlobal.inputTextBox = LGlobal.inputTextareaBoxObj
} else {
LGlobal.inputTextBox = LGlobal.inputTextBoxObj
}
n = parseInt(LGlobal.canvasObj.style.width) / LGlobal.canvasObj.width;
sy = parseInt(LGlobal.canvasObj.style.height) / LGlobal.canvasObj.height;
LGlobal.inputTextBox.style.display = "";
LGlobal.inputTextBox.value = e.text;
LGlobal.inputTextBox.style.height = e.inputBackLayer.getHeight() * t.scaleY * e.scaleY * sy + "px";
LGlobal.inputTextBox.style.width = e.inputBackLayer.getWidth() * t.scaleX * e.scaleX * n + "px";
LGlobal.inputTextBox.style.color = e.color;
LGlobal.inputTextBox.style.fontSize = (e.size * parseFloat(LGlobal.canvasObj.style.height) / LGlobal.canvasObj.height >> 0) + "px";
LGlobal.inputTextBox.style.fontFamily = e.font;
LEvent.addEventListener(LGlobal.inputTextBox, LKeyboardEvent.KEY_DOWN, LGlobal.inputTextField._ll_input);
if (e.texttype == LTextFieldType.INPUT) {
rc = e.getRootCoordinate();
if (LGlobal.inputBox.name == "input" + e.objectIndex) {
LGlobal.inputBox.style.marginTop = parseInt(LGlobal.canvasObj.style.marginTop) + ((rc.y + e.inputBackLayer.startY()) * parseInt(LGlobal.canvasObj.style.height) / LGlobal.canvasObj.height >>> 0) + "px";
LGlobal.inputBox.style.marginLeft = parseInt(LGlobal.canvasObj.style.marginLeft) + ((rc.x + e.inputBackLayer.startX()) * parseInt(LGlobal.canvasObj.style.width) / LGlobal.canvasObj.width >>> 0) + "px"
}
}
setTimeout(function() {
LGlobal.inputTextBox.focus()
}, 0)
},
_getWidth: function() {
var e = this;
if (e.wordWrap) {
return e.width
}
LGlobal.canvas.font = e.size + "pt " + e.font;
return LGlobal.canvas.measureText(e.text).width
},
getWidth: function(e) {
var t = this,
n, r, i;
n = t._getWidth() * t.scaleX;
if (e && t.mask) {
r = t.mask._startX ? t.mask._startX() : t.mask.startX();
if (r > n) {
return 0
}
i = t.mask.getWidth();
if (r + i > n) {
return n - r
} else {
return i
}
}
return n
},
_getHeight: function() {
var t = this,
n = LGlobal.canvas,
r, i, s, o, u, a;
if (t.wordWrap) {
n.font = t.weight + " " + t.size + "pt " + t.font;
if (t.height == 0) {
s = 0, o = 0, u = 0;
for (r = 0, i = t.text.length; r < i; r++) {
s = n.measureText(t.text.substr(o, r - o)).width;
a = /(?:\r\n|\r|\n|Â¥n)/.exec(t.text.substr(r, 1));
if (t.wordWrap && s > t.width || a) {
s = 0;
o = r;
u++;
if (a) {
o++
}
}
}
t.height = (u + 1) * t.wordHeight
}
return t.height
}
n.font = t.weight + " " + t.size + "pt " + t.font;
i = n.measureText("O").width * 1.2;
if (t.heightMode == e.HEIGHT_MODE_BASELINE) {
i = i * 1.2
}
return i
},
getHeight: function(e) {
var t = this,
n, r, i;
n = t._getHeight() * t.scaleY;
if (e && t.mask) {
r = t.mask._startY ? t.mask._startY() : t.mask.startY();
if (r > n) {
return 0
}
i = t.mask.getHeight();
if (r + i > n) {
return n - r
} else {
return i
}
}
return n
},
wind: function(e) {
var t = this;
t.wind_over_function = e;
t.windRunning = true;
t._ll_wind_text = t.text;
t.text = "";
t._ll_wind_length = 0
},
_ll_windRun: function() {
var e = this;
if (e._speedIndex++ < e.speed) {
return
}
e._speedIndex = 0;
if (e._ll_wind_length > e._ll_wind_text.length) {
e.windRunning = false;
if (e.wind_over_function) {
e.wind_over_function()
}
e.dispatchEvent(new LEvent(LTextEvent.WIND_COMPLETE));
return
}
e.text = e._ll_wind_text.substring(0, e._ll_wind_length);
e._ll_wind_length++
},
die: function() {
LMouseEventContainer.removeInputBox(this)
}
};
for (var n in t) {
e.prototype[n] = t[n]
}
return e
}();
var LBitmap = function() {
function e(e) {
var t = this;
LExtends(t, LDisplayObject, []);
t.type = "LBitmap";
t.rotateCenter = true;
t.bitmapData = e;
if (t.bitmapData) {
t.width = t.bitmapData.width;
t.height = t.bitmapData.height
}
}
var t = {
_canShow: function() {
return this.visible && this.bitmapData
},
_rotateReady: function() {
var e = this;
if (e.rotate != 0 && e.rotateCenter) {
e.rotatex = e.getWidth() * .5;
e.rotatey = e.getHeight() * .5
} else {
e.rotatex = e.rotatey = 0
}
},
_coordinate: function(e) {},
_ll_show: function() {
this.ll_draw()
},
ll_draw: function() {
var e = this;
LGlobal.canvas.drawImage(e.bitmapData.image, e.bitmapData.x, e.bitmapData.y, e.bitmapData.width, e.bitmapData.height, e.x, e.y, e.bitmapData.width, e.bitmapData.height)
},
clone: function() {
var t = this,
n = new e(t.bitmapData.clone());
n.copyProperty(t);
n.rotateCenter = t.rotateCenter;
return n
},
ismouseon: function(e, t) {
var n = this;
if (!e) {
return false
}
if (!n.visible || !n.bitmapData) {
return false
}
if (n.mask) {
if (!n.mask.parent) {
n.mask.parent = n.parent
}
if (!n.mask.ismouseon(e, t)) {
return false
}
}
return n.ismouseonShapes([{
type: LShape.RECT,
arg: [0, 0, n.bitmapData.width, n.bitmapData.height]
}], e.offsetX, e.offsetY)
},
getWidth: function(e) {
var t = this,
n, r, i;
n = t.bitmapData != null ? t.bitmapData.width * (t.scaleX > 0 ? t.scaleX : -t.scaleX) : 0;
if (e && t.mask) {
r = t.mask._startX ? t.mask._startX() : t.mask.startX();
if (r > n) {
return 0
}
i = t.mask.getWidth();
if (r + i > n) {
return n - r
} else {
return i
}
}
return n
},
getHeight: function(e) {
var t = this,
n, r, i;
n = t.bitmapData != null ? t.bitmapData.height * (t.scaleY > 0 ? t.scaleY : -t.scaleY) : 0;
if (e && t.mask) {
r = t.mask._startY ? t.mask._startY() : t.mask.startY();
if (r > n) {
return 0
}
i = t.mask.getHeight();
if (r + i > n) {
return n - r
} else {
return i
}
}
return n
},
startX: function() {
return this.x
},
startY: function() {
return this.y
},
die: function() {}
};
for (var n in t) {
e.prototype[n] = t[n]
}
return e
}();
var LBitmapData = function() {
function e(t, n, r, i, s, o) {
var u = this;
LExtends(u, LObject, []);
u.type = "LBitmapData";
if (typeof o == UNDEFINED) {
o = e.DATA_IMAGE
}
u.oncomplete = null;
u._locked = false;
u._setPixel = false;
u.x = n == null ? 0 : n;
u.y = r == null ? 0 : r;
u.width = 0;
u.height = 0;
u.dataType = null;
if (t && typeof t == "object") {
u.image = t;
u.dataType = e.DATA_IMAGE;
u.width = i == null ? u.image.width : i;
u.height = s == null ? u.image.height : s;
u._setDataType(o)
} else {
u._createCanvas();
u.dataType = e.DATA_CANVAS;
u._canvas.width = u.width = i == null ? 1 : i;
u._canvas.height = u.height = s == null ? 1 : s;
if (typeof t == "string") {
t = parseInt(t.replace("#", "0x"))
}
if (typeof t == "number") {
var a = u._context.createImageData(u.width, u.height);
for (var f = 0; f < a.data.length; f += 4) {
a.data[f + 0] = t >> 16 & 255;
a.data[f + 1] = t >> 8 & 255;
a.data[f + 2] = t & 255;
a.data[f + 3] = 255
}
u._context.putImageData(a, 0, 0)
}
u.image = u._canvas;
if (o == e.DATA_IMAGE) {
u._setDataType(o)
}
}
u.resize()
}
e.DATA_IMAGE = "data_image";
e.DATA_CANVAS = "data_canvas";
var t = {
_setDataType: function(t) {
var n = this;
if (n.dataType == t) {
return
}
if (t == e.DATA_CANVAS) {
n._createCanvas();
n._canvas.width = n.image.width;
n._canvas.height = n.image.height;
n._context.clearRect(0, 0, n._canvas.width, n._canvas.height);
n._context.drawImage(n.image, 0, 0);
n.image = n._canvas
} else if (t == e.DATA_IMAGE) {
n.image = new Image;
n.image.width = n._canvas.width;
n.image.height = n._canvas.height;
n.image.src = n._canvas.toDataURL()
}
n.dataType = t
},
_createCanvas: function() {
var e = this;
if (!e._canvas) {
e._canvas = document.createElement("canvas");
e._context = e._canvas.getContext("2d")
}
},
clear: function() {
var t = this;
t._createCanvas();
t._canvas.width = t.image.width;
if (t.dataType == e.DATA_IMAGE) {
t.image.src = t._canvas.toDataURL()
}
},
setProperties: function(e, t, n, r) {
var i = this;
i.x = e;
i.y = t;
i.width = n;
i.height = r;
i.resize()
},
setCoordinate: function(e, t) {
var n = this;
n.x = e;
n.y = t;
n.resize()
},
clone: function() {
var t = this;
return new e(t.image, t.x, t.y, t.width, t.height, t.dataType)
},
_ready: function() {
var t = this;
t._dataType = t.dataType;
t._setDataType(e.DATA_CANVAS);
t._data = t._context.getImageData(t.x, t.y, t.width, t.height)
},
_update: function() {
var e = this;
e._context.putImageData(e._data, e.x, e.y, 0, 0, e.width, e.height);
e._setDataType(e._dataType);
e._data = null
},
getPixel: function(e, t, n) {
var r = this,
i, s;
e = e >> 0;
t = t >> 0;
if (!r._locked) {
r._ready()
}
i = r.width * 4 * t + e * 4;
s = r._data.data;
if (!r._locked) {
r._update()
}
if (n == "number") {
return s[i] << 16 | s[i + 1] << 8 | s[i + 2]
} else {
return [s[i], s[i + 1], s[i + 2], s[i + 3]]
}
},
setPixel: function(e, t, n) {
var r = this;
e = e >> 0;
t = t >> 0;
if (!r._locked) {
r._ready()
}
var i = r._data,
s = r.width * 4 * t + e * 4;
if (typeof n == "object") {
i.data[s + 0] = n[0];
i.data[s + 1] = n[1];
i.data[s + 2] = n[2];
i.data[s + 3] = n[3]
} else {
if (typeof n == "string") {
n = parseInt(n.replace("#", "0x"))
}
i.data[s + 0] = n >> 16 & 255;
i.data[s + 1] = n >> 8 & 255;
i.data[s + 2] = n & 255;
i.data[s + 3] = 255
} if (!r._locked) {
r._update()
}
},
getPixels: function(e) {
var t = this,
n;
if (!t._locked) {
t._ready()
}
n = t._context.getImageData(t.x + e.x, t.y + e.y, e.width, e.height);
if (!t._locked) {
t._update()
}
return n
},
setPixels: function(e, t) {
var n = this,
r, i, s, o, u, a, f;
if (!n._locked) {
n._ready()
}
s = n._data;
if (typeof t == "object") {
o = n._canvas.width;
for (a = e.x; a < e.right; a++) {
for (f = e.y; f < e.bottom; f++) {
r = o * 4 * (n.y + f) + (n.x + a) * 4;
i = t.width * 4 * (f - e.y) + (a - e.x) * 4;
s.data[r + 0] = t.data[i + 0];
s.data[r + 1] = t.data[i + 1];
s.data[r + 2] = t.data[i + 2];
s.data[r + 3] = t.data[i + 3]
}
}
} else {
if (typeof t == "string") {
t = parseInt(t.replace("#", "0x"))
}
t = [t >> 16 & 255, t >> 8 & 255, t & 255];
o = n._canvas.width;
for (a = e.x; a < e.right; a++) {
for (f = e.y; f < e.bottom; f++) {
r = o * 4 * (n.y + f) + (n.x + a) * 4;
s.data[r + 0] = t[0];
s.data[r + 1] = t[1];
s.data[r + 2] = t[2];
s.data[r + 3] = 255
}
}
} if (!n._locked) {
n._update()
}
},
putPixels: function(t, n) {
var r = this;
if (r.dataType != e.DATA_CANVAS || typeof n != "object") {
return
}
r._context.putImageData(n, r.x + t.x, r.y + t.y, 0, 0, t.width, t.height)
},
lock: function() {
var e = this;
e._locked = true;
e._ready()
},
unlock: function() {
var e = this;
e._locked = false;
e._update()
},
draw: function(t, n, r, i, s) {
var o = this,
u, a = t,
f, l, c, h, p = false;
var d = o.dataType;
o._setDataType(e.DATA_CANVAS);
if (n || r || i || s) {
o._context.save();
p = true
}
if (s) {
if (!(a instanceof e)) {
f = l = 0
} else {
f = a.x;
l = a.y
}
a = new e(a.getDataCanvas(), f + s.x, l + s.y, s.width, s.height, e.DATA_CANVAS)
}
c = a.getWidth() >>> 0;
h = a.getHeight() >>> 0;
if (c == 0 || h == 0) {
o._setDataType(d);
return
}
u = a.getDataCanvas();
if (r) {
a.colorTransform(new LRectangle(0, 0, c, h), r);
u = a.image
}
if (n) {
o._context.setTransform(n.a, n.b, n.c, n.d, n.tx, n.ty)
}
if (i) {
o._context.globalCompositeOperation = i
}
o._context.drawImage(u, a.x, a.y, c, h, 0, 0, c, h);
if (p) {
o._context.restore()
}
o._setDataType(d);
o.resize()
},
getDataCanvas: function() {
var t = this;
var n = t.dataType;
t._setDataType(e.DATA_CANVAS);
t._setDataType(n);
return t._canvas
},
getWidth: function() {
return this.width
},
getHeight: function() {
return this.height
},
resize: function() {
var e = this,
t = e.image.width - e.x,
n = e.image.height - e.y;
e.width = e.width < t ? e.width : t;
e.height = e.height < n ? e.height : n
},
colorTransform: function(t, n) {
var r = this;
if (r.dataType != e.DATA_CANVAS) {
return
}
var i = t.x >> 0,
s = t.y >> 0,
o = t.width >> 0,
u = t.height >> 0;
var a = r._context.getImageData(r.x + t.x, r.y + t.y, t.width, t.height);
var f = a.data;
for (var l = 0, c = f.length; l < c; l += 4) {
var h = l,
p = l + 1,
d = l + 2,
v = l + 3;
f[h] = f[h] * n.redMultiplier + n.redOffset;
f[p] = f[p] * n.greenMultiplier + n.greenOffset;
f[d] = f[d] * n.blueMultiplier + n.blueOffset;
f[v] = f[v] * n.alphaMultiplier + n.alphaOffset
}
r._context.putImageData(a, r.x + t.x, r.y + t.y, 0, 0, t.width, t.height)
},
copyPixels: function(t, n, r) {
var i = this,
s, o, u, a, f = t;
if (i.dataType != e.DATA_CANVAS) {
return
}
s = f.x;
o = f.y;
u = f.width;
a = f.height;
f.setProperties(n.x + f.x, n.y + f.y, n.width, n.height);
i._context.drawImage(f.image, f.x, f.y, f.width, f.height, r.x, r.y, f.width, f.height);
f.x = s;
f.y = o;
f.width = u;
f.height = a
}
};
for (var n in t) {
e.prototype[n] = t[n]
}
return e
}();
var LDropShadowFilter = function() {
function e(e, t, n, r) {
var i = this;
LExtends(i, LObject, []);
i.type = "LDropShadowFilter";
i.distance = e ? e : 0;
i.angle = t ? t : 0;
i.shadowColor = n ? n : "#000000";
i.shadowBlur = r ? r : 20;
i.setShadowOffset()
}
var t = {
setShadowOffset: function() {
var e = this;
var t = e.angle * Math.PI / 180;
e.shadowOffsetX = e.distance * Math.cos(t);
e.shadowOffsetY = e.distance * Math.sin(t)
},
ll_show: function() {
var e = this,
t = LGlobal.canvas;
t.shadowColor = e.shadowColor;
t.shadowBlur = e.shadowBlur;
t.shadowOffsetX = e.shadowOffsetX;
t.shadowOffsetY = e.shadowOffsetY
},
setDistance: function(e) {
this.distance = e;
this.setShadowOffset()
},
setAngle: function(e) {
this.angle = e;
this.setShadowOffset()
},
setColor: function(e) {
this.shadowColor = e
},
setBlur: function(e) {
this.shadowBlur = e
}
};
for (var n in t) {
e.prototype[n] = t[n]
}
return e
}();
var LAnimation = function() {
function e(e, t, n) {
var r = this;
LExtends(r, LSprite, []);
r.type = "LAnimation";
r.rowIndex = 0;
r.colIndex = 0;
r._ll_stepIndex = 0;
r._ll_stepArray = [];
r.mode = 1;
r.isMirror = false;
r.bitmap = new LBitmap(t);
r.imageArray = n;
r.addChild(r.bitmap);
if (e != null) {
e.addChild(r)
}
r.onframe();
r.colIndex = 0
}
var t = {
setAction: function(e, t, n, r) {
var i = this,
s = false;
if (e != null && e >= 0 && e < i.imageArray.length) {
i.rowIndex = e;
s = true
}
if (t != null && t >= 0 && t < i.imageArray[e].length) {
i.colIndex = t;
s = true
}
if (n != null) {
i.mode = n;
s = true
}
if (r != null) {
i.isMirror = r;
if (i.isMirror) {
i.bitmap.x = i.bitmap.getWidth();
i.bitmap.scaleX = -1 * Math.abs(i.bitmap.scaleX)
} else {
i.bitmap.x = 0;
i.bitmap.scaleX = Math.abs(i.bitmap.scaleX)
}
s = true
}
if (s) {
i._ll_stepIndex = 0
}
},
getAction: function() {
var e = this;
return [e.rowIndex, e.colIndex, e.mode, e.isMirror]
},
onframe: function() {
var e = this,
t, n = null;
if (e.colIndex >= e.imageArray[e.rowIndex].length) {
e.colIndex = 0
}
t = e.imageArray[e.rowIndex][e.colIndex];
if (e._ll_stepArray[e.rowIndex] && e._ll_stepArray[e.rowIndex][e.colIndex]) {
n = e._ll_stepArray[e.rowIndex][e.colIndex]
} else {
n = 0
} if (e._ll_stepIndex == 0) {
if (typeof t.script == "function") {
t.script(e, t.params)
}
if (typeof t.width != UNDEFINED && typeof t.height != UNDEFINED) {
e.bitmap.bitmapData.setProperties(t.x, t.y, t.width, t.height)
} else {
e.bitmap.bitmapData.setCoordinate(t.x, t.y)
} if (typeof t.sx != UNDEFINED) {
e.bitmap.x = t.sx
}
if (typeof t.sy != UNDEFINED) {
e.bitmap.y = t.sy
}
if (typeof t.mirror != UNDEFINED) {
e.bitmap.rotateCenter = false;
if (t.mirror) {
e.bitmap.x = e.bitmap.getWidth();
e.bitmap.scaleX = -1 * Math.abs(e.bitmap.scaleX)
} else {
e.bitmap.x = 0;
e.bitmap.scaleX = Math.abs(e.bitmap.scaleX)
}
}
}
if (e._ll_stepIndex++ < n) {
return
}
e._ll_stepIndex = 0;
e.colIndex += e.mode;
if (e.colIndex >= e.imageArray[e.rowIndex].length || e.colIndex < 0) {
e.colIndex = e.mode > 0 ? 0 : e.imageArray[e.rowIndex].length - 1;
e.dispatchEvent(LEvent.COMPLETE)
}
},
clone: function() {
var t = this,
n = new e(null, t.bitmap.bitmapData, t.imageArray.slice(0));
n.copyProperty(t);
n.childList.length = 0;
n.bitmap = t.bitmap.clone();
n.addChild(n.bitmap);
return n
}
};
for (var n in t) {
e.prototype[n] = t[n]
}
return e
}();
var LAnimationTimeline = function() {
function e(e, t) {
var n = this;
LExtends(n, LAnimation, [null, e, t]);
n.type = "LAnimationTimeline";
n.speed = 0;
n._speedIndex = 0;
n.ll_labelList = {};
for (var r = 0, i, s, o; r < t.length; r++) {
i = t[r];
for (s = 0; s < i.length; s++) {
o = i[s];
if (o.label) {
n.setLabel(o.label, r, s, 1, o.isMirror ? true : false)
}
}
}
n.addEventListener(LEvent.ENTER_FRAME, n._ll_onframe)
}
var t = {
clone: function() {
var e = this,
t, n, r = new LAnimation(null, e.bitmap.bitmapData, e.imageArray.slice(0));
r.copyProperty(e);
r.childList.length = 0;
r.bitmap = e.bitmap.clone();
r.addChild(r.bitmap);
for (t in e.ll_labelList) {
n = e.ll_labelList[t];
r.ll_labelList[t] = {
rowIndex: n.rowIndex,
colIndex: n.colIndex,
mode: n.mode,
isMirror: n.isMirror
}
}
return r
},
setFrameSpeedAt: function(e, t, n) {
var r = this;
if (!r._ll_stepArray[e]) {
r._ll_stepArray[e] = []
}
r._ll_stepArray[e][t] = n
},
_ll_onframe: function(e) {
var t = e.target;
if (t._ll_stop) {
return
}
if (t._speedIndex++ < t.speed) {
return
}
t._speedIndex = 0;
t.onframe()
},
setLabel: function(e, t, n, r, i) {
this.ll_labelList[e] = {
rowIndex: t,
colIndex: n,
mode: r,
isMirror: i
}
},
play: function() {
this._ll_stop = false
},
stop: function() {
this._ll_stop = true
},
gotoAndPlay: function(e) {
var t = this,
n = t.ll_labelList[e];
t.setAction(n.rowIndex, n.colIndex, n.mode, n.isMirror);
t.onframe();
t.play()
},
gotoAndStop: function(e) {
var t = this,
n = t.ll_labelList[e];
t.setAction(n.rowIndex, n.colIndex, n.mode, n.isMirror);
t.onframe();
t.stop()
},
addFrameScript: function(e, t, n) {
var r = this.ll_labelList[e];
var i = this.imageArray[r.rowIndex][r.colIndex];
i.script = t;
i.params = n ? n : null
},
removeFrameScript: function(e) {
var t = this.ll_labelList[e];
this.imageArray[t.rowIndex][t.colIndex].script = null
}
};
for (var n in t) {
e.prototype[n] = t[n]
}
return e
}();
var LLoadManage = function() {
function e() {
this.llname = "ll.file.";
this.llload = "ll.load."
}
e.prototype = {
load: function(e, t, n) {
var r = this;
r.list = e, r.onupdate = t, r.oncomplete = n;
r.loader = r, r.index = 0, r.loadIndex = 0, r.result = [], r.lresult = [];
r.loadInit()
},
loadInit: function() {
var e = this;
if (e.index >= e.list.length) {
return
}
e.loadIndex = 0;
e.loadStart();
e.reloadtime = setTimeout(e.loadInit.bind(e), 1e4)
},
loadStart: function() {
var e = this,
t, n, r, i;
if (e.loadIndex >= e.list.length) {
return
}
t = e.list[e.loadIndex];
if (!t.name) {
t.name = e.llname + e.loadIndex
}
if (!e.lresult[e.llload + t.name]) {
if (!t["type"]) {
i = getExtension(t.path);
if (i == "txt") {
t["type"] = LURLLoader.TYPE_TEXT
} else if (i == "js") {
t["type"] = LURLLoader.TYPE_JS
} else if ((new Array("mp3", "ogg", "wav", "m4a")).indexOf(i) >= 0) {
t["type"] = LSound.TYPE_SOUND
}
}
if (t["type"] == LURLLoader.TYPE_TEXT || t["type"] == LURLLoader.TYPE_JS) {
e.loader = new LURLLoader;
e.loader.name = t.name;
e.loader.addEventListener(LEvent.COMPLETE, e.loadComplete.bind(e));
e.loader.load(e.url(t.path), t["type"])
} else if (t["type"] == LSound.TYPE_SOUND) {
e.loader = new LSound;
e.loader.name = t.name;
e.loader.addEventListener(LEvent.COMPLETE, e.loadComplete.bind(e));
e.loader.load(t.path)
} else {
e.loader = new LLoader;
e.loader.name = t.name;
e.loader.addEventListener(LEvent.COMPLETE, e.loadComplete.bind(e));
e.loader.load(e.url(t.path), LLoader.TYPE_BITMAPDATE)
}
}
e.loadIndex++;
e.loadStart()
},
loadComplete: function(e) {
var t = this;
if (e && e.currentTarget && e.currentTarget.name) {
e.currentTarget.removeEventListener(LEvent.COMPLETE, t.loadComplete);
if (e.currentTarget.name.indexOf(t.llname) >= 0) {
e.target = 1
}
if (t.lresult[t.llload + e.currentTarget.name]) {
return
}
t.result[e.currentTarget.name] = e.target;
t.lresult[t.llload + e.currentTarget.name] = 1
}
t.index++;
if (t.onupdate) {
t.onupdate(Math.floor(t.index * 100 / t.list.length))
}
if (t.index >= t.list.length) {
if (t.reloadtime) {
clearTimeout(t.reloadtime)
}
t.loader = null;
var n = t.result;
LGlobal.forceRefresh = true;
t.oncomplete(n)
}
},
url: function(e) {
if (!LGlobal.traceDebug) {
return e
}
return e + (e.indexOf("?") >= 0 ? "&" : "?") + "t=" + (new Date).getTime()
}
};
return new e
}();
var LEasing = {
None: {
easeIn: function(e, t, n, r) {
return t + e * n / r
},
easeOut: function(e, t, n, r) {
return t + e * n / r
},
easeInOut: function(e, t, n, r) {
return t + e * n / r
}
},
Quad: {
easeIn: function(e, t, n, r) {
return n * (e /= r) * e + t
},
easeOut: function(e, t, n, r) {
return -n * (e /= r) * (e - 2) + t
},
easeInOut: function(e, t, n, r) {
if ((e /= r / 2) < 1) {
return n / 2 * e * e + t
}
return -n / 2 * (--e * (e - 2) - 1) + t
}
},
Cubic: {
easeIn: function(e, t, n, r) {
return n * (e /= r) * e * e + t
},
easeOut: function(e, t, n, r) {
return n * ((e = e / r - 1) * e * e + 1) + t
},
easeInOut: function(e, t, n, r) {
if ((e /= r / 2) < 1) {
return n / 2 * e * e * e + t
}
return n / 2 * ((e -= 2) * e * e + 2) + t
}
},
Quart: {
easeIn: function(e, t, n, r) {
return n * (e /= r) * e * e * e + t
},
easeOut: function(e, t, n, r) {
return -n * ((e = e / r - 1) * e * e * e - 1) + t
},
easeInOut: function(e, t, n, r) {
if ((e /= r / 2) < 1) {
return n / 2 * e * e * e * e + t
}
return -n / 2 * ((e -= 2) * e * e * e - 2) + t
}
},
Quint: {
easeIn: function(e, t, n, r) {
return n * (e /= r) * e * e * e * e + t
},
easeOut: function(e, t, n, r) {
return n * ((e = e / r - 1) * e * e * e * e + 1) + t
},
easeInOut: function(e, t, n, r) {
if ((e /= r / 2) < 1) {
return n / 2 * e * e * e * e * e + t
}
return n / 2 * ((e -= 2) * e * e * e * e + 2) + t
}
},
Sine: {
easeIn: function(e, t, n, r) {
return -n * Math.cos(e / r * (Math.PI / 2)) + n + t
},
easeOut: function(e, t, n, r) {
return n * Math.sin(e / r * (Math.PI / 2)) + t
},
easeInOut: function(e, t, n, r) {
return -n / 2 * (Math.cos(Math.PI * e / r) - 1) + t
}
},
Strong: {
easeIn: function(e, t, n, r) {
return n * (e /= r) * e * e * e * e + t
},
easeOut: function(e, t, n, r) {
return n * ((e = e / r - 1) * e * e * e * e + 1) + t
},
easeInOut: function(e, t, n, r) {
if ((e /= r / 2) < 1) {
return n / 2 * e * e * e * e * e + t
}
return n / 2 * ((e -= 2) * e * e * e * e + 2) + t
}
},
Expo: {
easeIn: function(e, t, n, r) {
return e == 0 ? t : n * Math.pow(2, 10 * (e / r - 1)) + t
},
easeOut: function(e, t, n, r) {
return e == r ? t + n : n * (-Math.pow(2, -10 * e / r) + 1) + t
},
easeInOut: function(e, t, n, r) {
if (e == 0) {
return t
}
if (e == r) {
return t + n
}
if ((e /= r / 2) < 1) {
return n / 2 * Math.pow(2, 10 * (e - 1)) + t
}
return n / 2 * (-Math.pow(2, -10 * --e) + 2) + t
}
},
Circ: {
easeIn: function(e, t, n, r) {
return -n * (Math.sqrt(1 - (e /= r) * e) - 1) + t
},
easeOut: function(e, t, n, r) {
return n * Math.sqrt(1 - (e = e / r - 1) * e) + t
},
easeInOut: function(e, t, n, r) {
if ((e /= r / 2) < 1) {
return -n / 2 * (Math.sqrt(1 - e * e) - 1) + t
}
return n / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + t
}
},
Elastic: {
easeIn: function(e, t, n, r, i, s) {
var o;
if (e == 0) {
return t
}
if ((e /= r) == 1) {
return t + n
}
if (!s) {
s = r * .3
}
if (!i || i < Math.abs(n)) {
i = n;
o = s / 4
} else {
o = s / (2 * Math.PI) * Math.asin(n / i)
}
return -(i * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * r - o) * 2 * Math.PI / s)) + t
},
easeOut: function(e, t, n, r, i, s) {
var o;
if (e == 0) {
return t
}
if ((e /= r) == 1) {
return t + n
}
if (!s) {
s = r * .3
}
if (!i || i < Math.abs(n)) {
i = n;
o = s / 4
} else {
o = s / (2 * Math.PI) * Math.asin(n / i)
}
return i * Math.pow(2, -10 * e) * Math.sin((e * r - o) * 2 * Math.PI / s) + n + t
},
easeInOut: function(e, t, n, r, i, s) {
var o;
if (e == 0) {
return t
}
if ((e /= r / 2) == 2) {
return t + n
}
if (!s) {
s = r * .3 * 1.5
}
if (!i || i < Math.abs(n)) {
i = n;
o = s / 4
} else {
o = s / (2 * Math.PI) * Math.asin(n / i)
} if (e < 1) {
return -.5 * i * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * r - o) * 2 * Math.PI / s) + t
}
return i * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * r - o) * 2 * Math.PI / s) * .5 + n + t
}
},
Back: {
easeIn: function(e, t, n, r, i) {
if (typeof i == UNDEFINED) {
i = 1.70158
}
return n * (e /= r) * e * ((i + 1) * e - i) + t
},
easeOut: function(e, t, n, r, i) {
if (typeof i == UNDEFINED) {
i = 1.70158
}
return n * ((e = e / r - 1) * e * ((i + 1) * e + i) + 1) + t
},
easeInOut: function(e, t, n, r, i) {
if (typeof i == UNDEFINED) {
i = 1.70158
}
if ((e /= r / 2) < 1) {
return n / 2 * e * e * (((i *= 1.525) + 1) * e - i) + t
}
return n / 2 * ((e -= 2) * e * (((i *= 1.525) + 1) * e + i) + 2) + t
}
},
Bounce: {
easeIn: function(e, t, n, r) {
return n - LEasing.Bounce.easeOut(r - e, 0, n, r) + t
},
easeOut: function(e, t, n, r) {
if ((e /= r) < 1 / 2.75) {
return n * 7.5625 * e * e + t
} else if (e < 2 / 2.75) {
return n * (7.5625 * (e -= 1.5 / 2.75) * e + .75) + t
} else if (e < 2.5 / 2.75) {
return n * (7.5625 * (e -= 2.25 / 2.75) * e + .9375) + t
} else {
return n * (7.5625 * (e -= 2.625 / 2.75) * e + .984375) + t
}
},
easeInOut: function(e, t, n, r) {
if (e < r / 2) {
return LEasing.Bounce.easeIn(e * 2, 0, n, r) * .5 + t
}
return LEasing.Bounce.easeOut(e * 2 - r, 0, n, r) * .5 + n * .5 + t
}
}
};
var Quad = LEasing.Quad,
Cubic = LEasing.Cubic,
Quart = LEasing.Quart,
Quint = LEasing.Quint,
Sine = LEasing.Sine,
Strong = LEasing.Strong,
Expo = LEasing.Expo,
Circ = LEasing.Circ,
Elastic = LEasing.Elastic,
Back = LEasing.Back,
Bounce = LEasing.Bounce;
var LTweenLiteTimeline;
var LTweenLite = function() {
function e(e, t, n) {
var r = this;
LExtends(r, LObject, []);
r.type = "LTweenLiteChild";
r.toNew = [];
r.init(e, t, n)
}
function r() {
LExtends(this, LObject, []);
this.type = "LTweenLite"
}
var t = {
init: function(e, t, n) {
var i = this,
s = null;
if (typeof n["tweenTimeline"] == UNDEFINED) {
n["tweenTimeline"] = r.TYPE_FRAME
}
i.target = e;
i.duration = t || .001;
i.vars = n;
i.delay = i.vars.delay || 0;
if (i.vars["tweenTimeline"] == r.TYPE_TIMER) {
i.currentTime = (new Date).getTime() / 1e3;
i.initTime = i.currentTime;
i.startTime = i.initTime + i.delay
} else {
i.currentTime = 0;
i.duration *= 1e3;
i.currentTime -= i.delay * 1e3
}
i.combinedTimeScale = i.vars.timeScale || 1;
i.active = i.duration == 0 && i.delay == 0;
i.varsto = {};
i.varsfrom = {};
i.stop = false;
if (typeof i.vars.ease != "function") {
i.vars.ease = LEasing.None.easeIn
}
i.ease = i.vars.ease;
delete i.vars.ease;
if (i.vars.onComplete) {
i.onComplete = i.vars.onComplete;
delete i.vars.onComplete
}
if (i.vars.onUpdate) {
i.onUpdate = i.vars.onUpdate;
delete i.vars.onUpdate
}
if (i.vars.onStart) {
i.onStart = i.vars.onStart;
delete i.vars.onStart
}
for (s in i.vars) {
i.varsto[s] = i.vars[s];
i.varsfrom[s] = i.target[s]
}
},
pause: function() {
this.stop = true
},
resume: function() {
this.stop = false
},
tween: function() {
var e = this,
t;
var n = e.vars["tweenTimeline"] == r.TYPE_TIMER;
if (n) {
var i = (new Date).getTime() / 1e3,
s = i - e.startTime;
if (s < 0) {
return
}
} else {
if (e.stop) {
return
}
e.currentTime += LGlobal.speed;
if (e.currentTime < 0) {
return
}
}
for (t in e.varsto) {
if (t == "tweenTimeline") {
continue
}
if (n) {
e.target[t] = e.ease(s, e.varsfrom[t], e.varsto[t] - e.varsfrom[t], e.duration)
} else {
e.target[t] = e.ease(e.currentTime, e.varsfrom[t], e.varsto[t] - e.varsfrom[t], e.duration)
}
}
if (e.onStart) {
e.onStart(e.target);
delete e.onStart
}
var o;
if (n) {
o = s >= e.duration
} else {
o = e.currentTime >= e.duration
} if (o) {
for (t in e.varsto) {
e.target[t] = e.varsto[t]
}
if (e.onComplete) {
e.target.target = e.target;
e.target.currentTarget = e;
e.onComplete(e.target);
delete e.target.currentTarget;
delete e.target.target
}
return true
} else if (e.onUpdate) {
e.onUpdate(e.target)
}
return false
},
to: function(e, t, n) {
var r = this;
r.toNew.push({
target: e,
duration: t,
vars: n
});
return r
},
keep: function() {
var e = this,
t, n, r;
if (e.toNew.length > 0) {
t = e.toNew.shift();
if (t.vars.loop) {
e.loop = true
}
if (e.loop) {
n = {};
for (r in t.vars) {
n[r] = t.vars[r]
}
e.to(t.target, t.duration, n)
}
e.init(t.target, t.duration, t.vars);
return true
}
return false
}
};
for (var n in t) {
e.prototype[n] = t[n]
}
r.TYPE_FRAME = "type_frame";
r.TYPE_TIMER = "type_timer";
t = {
tweens: [],
ll_show: null,
frame: function() {
var e = this;
var t, n = e.tweens.length,
r;
for (t = 0; t < n; t++) {
r = e.tweens[t];
if (r && r.tween && r.tween()) {
e.tweens.splice(t, 1);
t--;
n = e.tweens.length;
if (r.keep()) {
e.add(r)
}
}
}
if (e.tweens.length == 0) {
e.ll_show = null
}
},
to: function(t, n, r) {
if (!t) {
return
}
var i = this;
var s = new e({}, 0, {});
i.tweens.push(s);
i.ll_show = i.frame;
s.to(t, n, r);
return s
},
add: function(e) {
this.tweens.push(e)
},
remove: function(e) {
var t = this;
if (typeof e == UNDEFINED) {
return
}
for (i = 0, l = t.tweens.length; i < l; i++) {
if (e.objectIndex == t.tweens[i].objectIndex) {
t.tweens.splice(i, 1);
break
}
}
},
removeAll: function() {
this.tweens.splice(0, this.tweens.length)
}
};
for (var n in t) {
r.prototype[n] = t[n]
}
LTweenLiteTimeline = new r;
LGlobal.childList.push(LTweenLiteTimeline);
var s = new r;
s.TYPE_FRAME = r.TYPE_FRAME;
s.TYPE_TIMER = r.TYPE_TIMER;
LGlobal.childList.push(s);
return s
}();
var LAjax = function() {
function e() {
this.responseType = null
}
e.prototype = {
TEXT: "text",
ARRAY_BUFFER: "arraybuffer",
BLOB: "blob",
get: function(e, t, n, r) {
this.getRequest("GET", e, t, n, r)
},
post: function(e, t, n, r) {
this.getRequest("POST", e, t, n, r)
},
getRequest: function(e, t, n, r, i) {
var s = this,
o, u = "",
a = "";
s.err = i;
var f = s.getHttp();
if (!f) {
return
}
if (n) {
for (o in n) {
u += a + o + "=" + n[o];
a = "&"
}
}
if (e.toLowerCase() == "get" && u.length > 0) {
t += (t.indexOf("?") >= 0 ? "&" : "?") + u;
u = null
}
f.open(e, t, true);
if (s.responseType) {
f.responseType = s.responseType;
s.responseType = s.TEXT
}
f.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
f.onreadystatechange = function() {
if (f.readyState == 4) {
if (f.status >= 200 && f.status < 300 || f.status === 304) {
if (r) {
if (f.responseType == s.ARRAY_BUFFER || f.responseType == s.BLOB) {
r(f.response)
} else if (f.responseText.length > 0) {
r(f.responseText)
} else {
r(null)
}
}
} else {
if (i) {
i(f)
}
}
}
};
f.send(u)
},
getHttp: function() {
if (typeof XMLHttpRequest != UNDEFINED) {
return new XMLHttpRequest
}
try {
return new ActiveXObject("Msxml2.XMLHTTP")
} catch (e) {
try {
return new ActiveXObject("Microsoft.XMLHTTP")
} catch (e) {
if (!this.err) {
this.err(e)
}
}
}
return false
}
};
return new e
}();
var LStageWebView = function() {
function e() {
var e = this;
LExtends(e, LEventDispatcher, []);
e.display = document.createElement("div");
e.iframe = document.createElement("iframe");
e.display.style.position = "absolute";
e.display.style.marginTop = "0px";
e.display.style.marginLeft = "0px";
e.display.style.zIndex = 11;
e.display.appendChild(e.iframe);
e.idAdded = false
}
var t = {
loadURL: function(e) {
var t = this;
t.iframe.src = e;
t.iframe.onload = function() {
t.dispatchEvent(LEvent.COMPLETE)
}
},
show: function() {
var e = this;
if (!e.idAdded) {
LGlobal.object.appendChild(e.display);
e.idAdded = true
}
if (e.display.style.display == "none") {
e.display.style.display = ""
}
},
die: function() {
LGlobal.object.removeChild(this.display);
this.idAdded = false
},
hide: function() {
this.display.style.display = "none"
},
setViewPort: function(e) {
var t = this,
n = parseInt(LGlobal.canvasObj.style.width) / LGlobal.canvasObj.width,
r = parseInt(LGlobal.canvasObj.style.height) / LGlobal.canvasObj.height;
t.display.style.marginTop = parseInt(LGlobal.canvasObj.style.marginTop) + (e.y * r >>> 0) + "px";
t.display.style.marginLeft = parseInt(LGlobal.canvasObj.style.marginLeft) + (e.x * n >>> 0) + "px";
t.iframe.style.width = t.display.style.width = (e.width * n >>> 0) + "px";
t.iframe.style.height = t.display.style.height = (e.height * r >>> 0) + "px"
}
};
for (var n in t) {
e.prototype[n] = t[n]
}
return e
}();
var FPS = function() {
function e() {
var e = this;
LExtends(e, LSprite, []);
e.fps = new LTextField;
e.fpsCount = 0;
e.fpsTime = (new Date).getTime();
e.fps.color = "#ffffff";
e.addChild(e.fps);
e.addEventListener(LEvent.ENTER_FRAME, e.showFPS)
}
e.prototype.showFPS = function(e) {
e.fpsCount++;
var t = (new Date).getTime();
if (t - e.fpsTime < 1e3) return;
e.fps.text = Math.round(e.fpsCount * 1e4 / (t - e.fpsTime)) / 10;
e.fpsTime = t;
e.fpsCount = 0;
e.graphics.clear();
e.graphics.drawRect(0, "#000000", [0, 0, e.fps.getWidth(), 20], true, "#000000")
};
return e
}();
var LQuadTree = function() {
function e(e) {
var t = this;
LExtends(t, LObject, []);
t.q1 = null;
t.q2 = null;
t.q3 = null;
t.q4 = null;
t.parent = null;
t.data = [];
t.rect = e;
t.root = t
}
e.prototype = {
createChildren: function(t) {
if (t == 0) {
return
}
var n = this;
var r = n.rect.width / 2,
i = n.rect.height / 2;
n.q1 = new e(new LRectangle(n.rect.x + r, n.rect.y, r, i));
n.q2 = new e(new LRectangle(n.rect.x + r, n.rect.y + i, r, i));
n.q3 = new e(new LRectangle(n.rect.x, n.rect.y + i, r, i));
n.q4 = new e(new LRectangle(n.rect.x, n.rect.y, r, i));
n.q1.parent = n.q2.parent = n.q3.parent = n.q4.parent = n;
n.q1.root = n.q2.root = n.q3.root = n.q4.root = n.root;
n.q1.createChildren(t - 1);
n.q2.createChildren(t - 1);
n.q3.createChildren(t - 1);
n.q4.createChildren(t - 1)
},
hasChildren: function() {
var e = this;
return e.q1 && e.q2 && e.q3 && e.q4
},
clear: function() {
var e = this;
if (e.hasChildren()) {
return e.q1.clear() || e.q2.clear() || e.q3.clear() || e.q4.clear()
} else {
e.q1 = null;
e.q2 = null;
e.q3 = null;
e.q4 = null;
e.parent = null;
e.data = [];
return e
}
},
add: function(e, t, n) {
var r = this;
if (!r.isIn(t, n)) {
return null
}
if (r.hasChildren()) {
return r.q1.add(e, t, n) || r.q2.add(e, t, n) || r.q3.add(e, t, n) || r.q4.add(e, t, n)
} else {
r.data.push(e);
return r
}
},
remove: function(e, t, n) {
var r = this;
if (!r.isIn(t, n)) {
return null
}
if (r.hasChildren()) {
return r.q1.remove(e, t, n) || r.q2.remove(e, t, n) || r.q3.remove(e, t, n) || r.q4.remove(e, t, n)
} else {
var i = r.data.indexOf(e);
if (i != -1) {
r.data.splice(i, 1);
return r
} else {
return null
}
}
},
isIn: function(e, t) {
var n = this;
return (typeof e == UNDEFINED || e >= n.rect.x && e < n.rect.right) && (typeof t == UNDEFINED || t >= n.rect.y && t < n.rect.bottom)
},
getDataInRect: function(e) {
var t = this;
if (!t.rect.intersects(e)) {
return []
}
var n = t.data.concat();
if (t.hasChildren()) {
n.push.apply(n, t.q1.getDataInRect(e));
n.push.apply(n, t.q2.getDataInRect(e));
n.push.apply(n, t.q3.getDataInRect(e));
n.push.apply(n, t.q4.getDataInRect(e))
}
return n
}
};
return e
}();
var LoadingSample1 = function() {
function e(e, t, n) {
base(this, LSprite, []);
var r = this;
r.numberList = new Array([1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1], [0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0], [1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1], [1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1], [1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1], [1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1], [1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1], [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1], [1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1]);
r.backgroundColor = t == null ? "#000000" : t;
r.color = n == null ? "#ffffff" : n;
r.progress = 0;
r.step = e == null ? LGlobal.width * .5 / 15 : e;
r.back = new LSprite;
r.addChild(r.back);
r.num = new LSprite;
r.addChild(r.num);
r.num.mask = new LSprite;
r.screenX = (LGlobal.width - r.step * 15) / 2;
r.screenY = (LGlobal.height - r.step * 5) / 2;
r.num.x = r.screenX;
r.num.y = r.screenY;
r.setProgress(r.progress)
}
e.prototype.setProgress = function(e) {
var t = this,
n = LGlobal.canvas;
var r = "",
i, s, o;
var u = t.step;
if (e >= 100) {
r = t.getNumber(1);
i = t.getNumber(0);
s = t.getNumber(0);
u = t.step * 3
} else if (e >= 10) {
i = t.getNumber(Math.floor(e / 10));
s = t.getNumber(e % 10)
} else {
i = t.getNumber(0);
s = t.getNumber(e)
}
t.back.graphics.clear();
t.back.graphics.add(function() {
n.beginPath();
n.fillStyle = t.backgroundColor;
n.fillRect(0, 0, LGlobal.width, LGlobal.height);
n.closePath();
n.fillStyle = t.color;
if (e >= 100) {
for (o = 0; o < r.length; o++) {
if (r[o] == 0) {
continue
}
n.fillRect(t.screenX + Math.floor(o % 3) * t.step, t.screenY + Math.floor(o / 3) * t.step, t.step, t.step)
}
}
for (o = 0; o < i.length; o++) {
if (i[o] == 0) {
continue
}
n.fillRect(t.screenX + u + Math.floor(o % 3) * t.step, t.screenY + Math.floor(o / 3) * t.step, t.step, t.step)
}
for (o = 0; o < s.length; o++) {
if (s[o] == 0) {
continue
}
n.fillRect(t.screenX + u + Math.floor(o % 3) * t.step + t.step * 4, t.screenY + Math.floor(o / 3) * t.step, t.step, t.step)
}
n.moveTo(t.screenX + u + t.step * 9.7, t.screenY);
n.lineTo(t.screenX + u + t.step * 10.5, t.screenY);
n.lineTo(t.screenX + u + t.step * 9.3, t.screenY + t.step * 5);
n.lineTo(t.screenX + u + t.step * 8.5, t.screenY + t.step * 5);
n.lineTo(t.screenX + u + t.step * 9.7, t.screenY);
n.fill();
n.moveTo(t.screenX + u + t.step * 8.5, t.screenY + t.step);
n.arc(t.screenX + u + t.step * 8.5, t.screenY + t.step, t.step * .6, 0, 360 + Math.PI / 180);
n.moveTo(t.screenX + u + t.step * 10.5, t.screenY + t.step * 4);
n.arc(t.screenX + u + t.step * 10.5, t.screenY + t.step * 4, t.step * .6, 0, 360 + Math.PI / 180);
n.fill()
});
t.num.mask.graphics.clear();
t.num.mask.graphics.add(function() {
if (e >= 100) {
for (o = 0; o < r.length; o++) {
if (r[o] == 0) {
continue
}
n.rect(t.screenX + Math.floor(o % 3) * t.step, t.screenY + Math.floor(o / 3) * t.step, t.step, t.step)
}
}
for (var o = 0; o < i.length; o++) {
if (i[o] == 0) {
continue
}
n.rect(t.screenX + u + Math.floor(o % 3) * t.step, t.screenY + Math.floor(o / 3) * t.step, t.step, t.step)
}
for (var o = 0; o < s.length; o++) {
if (s[o] == 0) {
continue
}
n.rect(t.screenX + u + Math.floor(o % 3) * t.step + t.step * 4, t.screenY + Math.floor(o / 3) * t.step, t.step, t.step)
}
});
n.fillStyle = LGlobal._create_loading_color();
t.num.graphics.clear();
t.num.graphics.drawRect(1, n.fillStyle, [0, t.step * 5 * (100 - e) * .01, LGlobal.width, LGlobal.height], true, n.fillStyle)
};
e.prototype.getNumber = function(e) {
return this.numberList[e]
};
return e
}();
LoadingSample2.prototype.setProgress = function(e) {
var t = this,
n = LGlobal.canvas;
t.progressLabel.text = e + "%";
t.showLabel.mask.clear();
t.showLabel.mask.drawRect(0, "#000000", [t.screenX, 0, t.screenWidth * e * .01, LGlobal.height]);
if (e >= 100) {
n.shadowOffsetX = 0;
n.shadowOffsetY = 0
}
};
LoadingSample3.prototype.onframe = function(e) {
var t, n, r;
if (e.progress >= 100) {
if (e.star.length > 0) {
for (t = 0, r = e.star.length; t < r; t++) {
e.removeChild(e.star[t])
}
e.star.length = 0
}
return
}
for (t = 0, r = e.star.length; t < r; t++) {
n = e.star[t];
n.alpha -= .1;
n.x += n.speedx;
n.y += n.speedy;
if (n.alpha <= 0) {
e.star.splice(t, 1);
e.removeChild(n);
t--, r--
}
}
if (e.star.length < 10) e.addStar()
};
LoadingSample3.prototype.addStar = function() {
var e = this,
t = LGlobal.canvas;
var n = new LSprite;
var r = 1 + Math.floor(Math.random() * 4);
n.graphics.add(function() {
t.beginPath();
t.fillStyle = "#ffffff";
t.lineTo(r * 2, r);
t.lineTo(r * 4, 0);
t.lineTo(r * 3, r * 2);
t.lineTo(r * 4, r * 4);
t.lineTo(r * 2, r * 3);
t.lineTo(0, r * 4);
t.lineTo(r, r * 2);
t.lineTo(0, 0);
t.fill()
});
n.x = e.screenX + e.screenWidth * e.progress * .01;
n.y = e.screenY;
n.speedx = 4 - 8 * Math.random();
n.speedy = 4 - 8 * Math.random();
e.star.push(n);
e.addChild(n)
};
LoadingSample3.prototype.setProgress = function(e) {
var t = this,
n = LGlobal.canvas;
if (e > 100) e = 100;
t.progress = e;
t.back.graphics.clear();
t.back.graphics.add(function() {
n.beginPath();
n.fillStyle = "#00FFFF";
n.rect(t.screenX - 3, t.screenY - 3, t.screenWidth + 6, t.screenHeight + 6);
n.fill();
n.beginPath();
n.fillStyle = "#990033";
n.rect(t.screenX, t.screenY, t.screenWidth, t.screenHeight);
n.fill();
n.beginPath();
n.fillStyle = t.color;
n.rect(t.screenX, t.screenY, t.screenWidth * e * .01, t.screenHeight);
n.fill()
});
t.label.text = e + "%"
};
LoadingSample4.prototype.onframe = function(e) {
e.target.arc.rotate += 20
};
LoadingSample4.prototype.setProgress = function(e) {
var t = this;
if (e > 100) e = 100;
t.progress = e;
t.label.text = e + "%";
t.label.x = LGlobal.width * .5 - t.label.getWidth() * .5
};
LoadingSample5.prototype.onframe = function(e) {
var t = e.target;
if (t.index++ < t.max) return;
t.index = 0;
t.arc.rotate += 30
};
LoadingSample5.prototype.setProgress = function(e) {
var t = this;
if (e > 100) e = 100;
t.progress = e;
t.label.text = e + "%";
t.label.x = LGlobal.width * .5 - t.label.getWidth() * .5
};
LoadingSample6.prototype._addHole = function() {
var e = this;
var t = e.holeAmount,
n = e.holeR * 2 + e.holesx,
r = e.holeR;
for (var i = 0; i < t; i++) {
var s = new LSprite;
s.x = i * n;
s.graphics.drawArc(1, "#111", [0, 0, r, 0, 2 * Math.PI], true, "#000");
s.graphics.drawArc(1, "#333", [0, 0, r, 1.7 * Math.PI, .7 * Math.PI], false);
e.holeLayer.addChild(s)
}
};
LoadingSample6.prototype.setProgress = function(e) {
var t = this;
var n = t.holeR * 2 + t.holesx,
r = t.holeR;
t.progress = e / 100;
var i = new Array;
while (Math.floor(t.progress / .2) > t.step) {
var s = r * 2;
var o = s;
var u = LGlobal.canvas.createLinearGradient(0, -o * 2, 0, o);
u.addColorStop(0, "white");
u.addColorStop(1, t.progressColor);
var a = new LSprite;
a.x = t.step * n;
a.scaleX = 0;
a.scaleY = 0;
a.graphics.drawArc(0, "", [0, 0, r, 0, 2 * Math.PI], true, u);
t.progressLayer.addChild(a);
i.push(a);
t.step++
}
var f = function(e) {
var n = new LSprite;
n.alpha = .9;
n.x = e.x;
n.graphics.drawArc(1, t.filterColor, [0, 0, r, 0, 2 * Math.PI], false);
t.progressLayer.addChild(n);
var i = new LDropShadowFilter(0, 5, t.filterColor, 10);
n.filters = [i];
LTweenLite.to(n, .5, {
scaleX: 1.7,
scaleY: 1.7,
alpha: 0,
onComplete: function(e) {
e.parent.removeChild(e)
}
})
};
for (var l = 0; l < i.length; l++) {
var c = i[l];
LTweenLite.to(c, 1, {
scaleX: 1,
scaleY: 1,
onComplete: f
})
}
};
LoadingSample7.prototype._addHole = function() {
var e = this;
var t = e.holeAmount,
n = e.holeW + e.holesx,
r = e.holeW,
i = e.holeH;
for (var s = 0; s < t; s++) {
var o = new LSprite;
o.x = s * n;
o.graphics.drawRect(1, "#333", [1, 1, e.holeW, e.holeH], false);
o.graphics.drawRect(1, "#111", [0, 0, e.holeW, e.holeH], true, "#000");
e.holeLayer.addChild(o);
var u = LGlobal.canvas.createLinearGradient(0, -i, 0, i);
u.addColorStop(0, "white");
u.addColorStop(1, e.progressColor);
var a = new LSprite;
a.alpha = 0;
a.x = s * n;
a.graphics.drawRect(0, "", [0, 0, e.holeW, e.holeH], true, u);
e.progressLayer.addChild(a)
}
};
LoadingSample7.prototype.setProgress = function(e) {
var t = this;
t.progress = e / 100;
if (Math.floor(t.progress / .1) > t.step) {
var n = Math.ceil(t.progress / .1);
if (n > 10) n = 10;
for (var r = 0; r < n; r++) {
var i = t.progressLayer.childList;
if (i[r].alpha > 0) continue;
var s = t.progressLayer.childList[r];
LTweenLite.to(s, 1, {
alpha: 1
})
}
t.step++
}
};
var LBox2d = function() {
function e(t, n, r) {
var i = this;
Box2D.Dynamics.b2World.prototype.LAddController = Box2D.Dynamics.b2World.prototype.AddController;
Box2D.Dynamics.b2World.prototype.AddController = function(t) {
var n = {},
r;
for (r in t) {
n[r] = t[r]
}
if (e) {
e.m_controllerList = n
}
return this.LAddController(t)
};
var s, o, u = Box2D,
a, f = [u.Collision, u.Common, u.Common.Math, u.Dynamics, u.Dynamics.Contacts, u.Dynamics.Controllers, u.Dynamics.Joints, u.Collision.Shapes];
for (s in f) {
for (o in f[s]) {
i[o] = f[s][o]
}
}
if (typeof r == UNDEFINED) {
r = 30
}
i.stop = false;
i.drawScale = 30;
i.selectedBody = null;
i.mouseJoint = null;
i.mousePVec = null;
i.contactListener = null;
if (typeof t == UNDEFINED) {
t = new i.b2Vec2(0, 9.8)
} else {
t = new i.b2Vec2(t[0], t[1])
} if (typeof n == UNDEFINED) {
n = true
}
i.world = new i.b2World(t, n);
i.removeList = new Array;
if (LGlobal.traceDebug) {
a = new i.b2DebugDraw;
a.SetSprite(LGlobal.canvas);
a.SetLineThickness(1);
a.SetFillAlpha(.5);
a.SetAlpha(1);
a.SetDrawScale(i.drawScale);
a.SetFlags(i.b2DebugDraw.e_shapeBit | i.b2DebugDraw.e_jointBit);
i.world.SetDebugDraw(a)
}
LGlobal.destroy = true
}
e.prototype = {
setEvent: function(e, t) {
var n = this;
if (e == LEvent.ENTER_FRAME) {
n.ll_enterFrame = t;
return
}
if (!n.contactListener) {
n.contactListener = new n.b2ContactListener;
n.world.SetContactListener(n.contactListener)
}
switch (e) {
case LEvent.END_CONTACT:
n.contactListener.EndContact = t;
break;
case LEvent.PRE_SOLVE:
n.contactListener.PreSolve = t;
break;
case LEvent.POST_SOLVE:
n.contactListener.PostSolve = t;
break;
case LEvent.BEGIN_CONTACT:
default:
n.contactListener.BeginContact = t
}
},
setWeldJoint: function(e, t) {
var n = this;
var r = new n.b2WeldJointDef;
r.Initialize(t, e, t.GetWorldCenter());
return n.world.CreateJoint(r)
},
setLineJoint: function(e, t, n, r, i) {
var s = this;
var o = new s.b2Vec2(n[0], n[1]);
var u = new s.b2LineJointDef;
u.Initialize(e, t, t.GetWorldCenter(), o);
if (r == null) {
u.enableLimit = false
} else {
u.lowerTranslation = r[0];
u.upperTranslation = r[1];
u.enableLimit = true
} if (i == null) {
u.enableMotor = false
} else {
u.maxMotorForce = i[0];
u.motorSpeed = i[1];
u.enableMotor = true
}
return s.world.CreateJoint(u)
},
setGearJoint: function(e, t, n, r, i) {
var s = this;
var o = new s.b2GearJointDef;
o.joint1 = r;
o.joint2 = i;
o.bodyA = e;
o.bodyB = t;
o.ratio = n * s.b2Settings.b2_pi / (300 / s.drawScale);
return s.world.CreateJoint(o)
},
setPrismaticJoint: function(e, t, n, r, i) {
var s = this;
var o = new s.b2Vec2(n[0], n[1]);
var u = new s.b2PrismaticJointDef;
u.Initialize(t, e, t.GetWorldCenter(), o);
if (r == null) {
u.enableLimit = false
} else {
u.lowerTranslation = r[0];
u.upperTranslation = r[1];
u.enableLimit = true
} if (i == null) {
u.enableMotor = false
} else {
u.maxMotorForce = i[0];
u.motorSpeed = i[1];
u.enableMotor = true
}
return s.world.CreateJoint(u)
},
setRevoluteJoint: function(e, t, n, r) {
var i = this;
var s = new i.b2RevoluteJointDef;
s.Initialize(e, t, t.GetWorldCenter());
if (n == null) {
s.enableLimit = false
} else {
s.lowerAngle = n[0] * i.b2Settings.b2_pi / 180;
s.upperAngle = n[1] * i.b2Settings.b2_pi / 180;
s.enableLimit = true
} if (r == null) {
s.enableMotor = false
} else {
s.maxMotorTorque = r[0];
s.motorSpeed = r[1];
s.enableMotor = true
}
return i.world.CreateJoint(s)
},
setDistanceJoint: function(e, t) {
var n = this;
var r = new n.b2DistanceJointDef;
r.Initialize(e, t, e.GetWorldCenter(), t.GetWorldCenter());
return n.world.CreateJoint(r)
},
setPulleyJoint: function(e, t, n, r, i) {
var s = this;
var o = e.GetWorldCenter();
var u = t.GetWorldCenter();
var a = new s.b2Vec2(o.x + n[0] / s.drawScale, o.y + n[1] / s.drawScale);
var f = new s.b2Vec2(u.x + r[0] / s.drawScale, u.y + r[1] / s.drawScale);
var l = new s.b2PulleyJointDef;
l.Initialize(e, t, a, f, o, u, i);
l.maxLengthA = n[2] / s.drawScale;
l.maxLengthB = r[2] / s.drawScale;
return s.world.CreateJoint(l)
},
addCircle: function(e, t, n, r, i, s, o) {
var u = this;
u.bodyDef = new u.b2BodyDef;
u.bodyDef.type = r;
u.fixDef = new u.b2FixtureDef;
u.fixDef.density = i;
u.fixDef.friction = s;
u.fixDef.restitution = o;
u.fixDef.shape = new u.b2CircleShape(e);
u.bodyDef.position.x = t;
u.bodyDef.position.y = n;
var a = u.world.CreateBody(u.bodyDef);
a.CreateFixture(u.fixDef);
return a
},
addPolygon: function(e, t, n, r, i, s, o, u) {
var a = this;
a.bodyDef = new a.b2BodyDef;
a.bodyDef.type = i;
a.fixDef = new a.b2FixtureDef;
a.fixDef.density = s;
a.fixDef.friction = o;
a.fixDef.restitution = u;
a.fixDef.shape = new a.b2PolygonShape;
a.fixDef.shape.SetAsBox(e, t);
a.bodyDef.position.x = n;
a.bodyDef.position.y = r;
var f = a.world.CreateBody(a.bodyDef);
f.CreateFixture(a.fixDef);
return f
},
addVertices: function(e, t, n, r, i) {
var s = this,
o, u;
s.bodyDef = new s.b2BodyDef;
s.bodyDef.type = t;
var a = s.world.CreateBody(s.bodyDef);
for (o = 0, u = e.length; o < u; o++) {
s.createShapeAsArray(a, e[o], t, n, r, i)
}
return a
},
createShapeAsArray: function(e, t, n, r, i, s) {
var o = this;
var u = new o.b2PolygonShape;
var a = o.createVerticesArray(t);
u.SetAsArray(a, 0);
var f = new o.b2FixtureDef;
f.shape = u;
f.density = r;
f.friction = i;
f.restitution = s;
e.CreateFixture(f)
},
createVerticesArray: function(e) {
var t = this,
n, r;
var i = new Array;
if (e.length < 3) {
return i
}
for (n = 0, r = e.length; n < r; n++) {
i.push(new t.b2Vec2(e[n][0] / t.drawScale, e[n][1] / t.drawScale))
}
return i
},
getBodyAtMouse: function(e, t) {
var n = this;
n.mousePVec = new n.b2Vec2(e, t);
var r = new n.b2AABB;
r.lowerBound.Set(e - .001, t - .001);
r.upperBound.Set(e + .001, t + .001);
n.selectedBody = null;
n.world.QueryAABB(n.getBodyCallBack, r);
return n.selectedBody
},
getBodyCallBack: function(e) {
var t = LGlobal.box2d;
if (e.GetBody().GetType() != t.b2Body.b2_staticBody) {
if (e.GetShape().TestPoint(e.GetBody().GetTransform(), t.mousePVec)) {
t.selectedBody = e.GetBody();
return false
}
}
return true
},
ll_show: function() {
var e = this,
t = null;
for (t in e.removeList) {
e.world.DestroyBody(e.removeList[t])
}
e.removeList.splice(0, e.removeList.length);
if (e.stop) {
return
}
if (e.ll_enterFrame) {
e.ll_enterFrame({
target: e
})
}
e.world.Step(1 / 30, 10, 10);
e.world.ClearForces();
if (LGlobal.traceDebug) {
e.world.DrawDebugData()
}
},
synchronous: function() {
var t = this;
var n = null,
r, i = null,
s = 0,
o = 0,
u, a;
for (u = t.world.GetBodyList(); u; u = u.GetNext()) {
r = u.GetUserData();
if (r) {
if (i == null) {
n = r.parent;
s = u.GetPosition().x;
o = u.GetPosition().y
}
u.SetPosition(new t.b2Vec2((r.x + r.rotatex + n.x) / t.drawScale, (r.y + r.rotatey + n.y) / t.drawScale));
if (i == null) {
i = {
x: u.GetPosition().x - s,
y: u.GetPosition().y - o
}
}
}
}
for (a = t.world.GetJointList(); a; a = a.GetNext()) {
if (a.m_groundAnchor1) {
a.m_groundAnchor1.x += i.x;
a.m_groundAnchor1.y += i.y
}
if (a.m_groundAnchor2) {
a.m_groundAnchor2.x += i.x;
a.m_groundAnchor2.y += i.y
}
}
if (e.m_controllerList && t.world.m_controllerList && n) {
LGlobal.box2d.world.m_controllerList.offset = e.m_controllerList.offset - n.y / LGlobal.box2d.drawScale
}
}
};
return e
}();
LSprite.prototype.setBodyMouseJoint = function(e) {
var t = this;
if (!t.box2dBody) {
return
}
t.box2dBody.mouseJoint = e
};
LSprite.prototype.clearBody = function(e) {
var t = this;
if (!t.box2dBody) {
return
}
LGlobal.box2d.removeList.push(t.box2dBody);
t.box2dBody = null
};
LSprite.prototype.addBodyCircle = function(e, t, n, r, i, s, o) {
var u = this;
u.rotatex = e;
u.rotatey = e;
u.box2dBody = LGlobal.box2d.addCircle(e / LGlobal.box2d.drawScale, (u.x + t) / LGlobal.box2d.drawScale, (u.y + n) / LGlobal.box2d.drawScale, r == 1 ? LGlobal.box2d.b2Body.b2_dynamicBody : LGlobal.box2d.b2Body.b2_staticBody, i == null ? .5 : i, s == null ? .4 : s, o == null ? .8 : o);
u.box2dBody.SetUserData(u)
};
LSprite.prototype.addBodyPolygon = function(e, t, n, r, i, s) {
var o = this;
o.rotatex = e / 2;
o.rotatey = t / 2;
o.box2dBody = LGlobal.box2d.addPolygon(e * .5 / LGlobal.box2d.drawScale, t * .5 / LGlobal.box2d.drawScale, o.x / LGlobal.box2d.drawScale, o.y / LGlobal.box2d.drawScale, n == 1 ? LGlobal.box2d.b2Body.b2_dynamicBody : LGlobal.box2d.b2Body.b2_staticBody, r == null ? .5 : r, i == null ? .4 : i, s == null ? .8 : s);
o.box2dBody.SetUserData(o)
};
LSprite.prototype.addBodyVertices = function(e, t, n, r, i, s, o) {
var u = this;
u.rotatex = 0;
u.rotatey = 0;
u.box2dBody = LGlobal.box2d.addVertices(e, r == 1 ? LGlobal.box2d.b2Body.b2_dynamicBody : LGlobal.box2d.b2Body.b2_staticBody, i, s, o);
u.box2dBody.SetUserData(u);
u.box2dBody.SetPosition(new LGlobal.box2d.b2Vec2((u.x + t) / LGlobal.box2d.drawScale, (u.y + n) / LGlobal.box2d.drawScale))
};
LGlobal.mouseJoint_start = function(e) {
if (!LGlobal.IS_MOUSE_DOWN || !LGlobal.box2d || LGlobal.box2d.mouseJoint || LGlobal.box2d.stop) {
return
}
var t = e.offsetX / LGlobal.box2d.drawScale,
n = e.offsetY / LGlobal.box2d.drawScale,
r = LGlobal.box2d.getBodyAtMouse(t, n);
if (r && r.mouseJoint) {
var i = new LGlobal.box2d.b2MouseJointDef;
i.bodyA = LGlobal.box2d.world.GetGroundBody();
i.bodyB = r;
i.target.Set(t, n);
i.collideConnected = true;
i.maxForce = 3e5 * r.GetMass();
LGlobal.box2d.mouseJoint = LGlobal.box2d.world.CreateJoint(i);
r.SetAwake(true)
}
};
LGlobal.mouseJoint_move = function(e) {
if (!LGlobal.IS_MOUSE_DOWN || !LGlobal.box2d || !LGlobal.box2d.mouseJoint) {
return
}
mX = e.offsetX / LGlobal.box2d.drawScale, mY = e.offsetY / LGlobal.box2d.drawScale;
LGlobal.box2d.mouseJoint.SetTarget(new LGlobal.box2d.b2Vec2(mX, mY))
};
LGlobal.mouseJoint_end = function() {
if (LGlobal.box2d != null && LGlobal.box2d.mouseJoint) {
LGlobal.box2d.world.DestroyJoint(LGlobal.box2d.mouseJoint);
LGlobal.box2d.mouseJoint = null
}
};
var LTransition = function() {
function e(e, t) {
this.child = e;
this.trans = t
}
e.prototype = {
startTransition: function() {
var t = this;
switch (t.trans.type) {
case e.Blinds:
t.blinds();
break;
case e.Fade:
t.fade();
break;
case e.Fly:
t.fly();
break;
case e.Iris:
t.iris();
break;
case e.Squeeze:
t.squeeze();
break;
case e.Wipe:
t.wipe();
break;
case e.Zoom:
t.zoom();
break;
case e.PixelDissolve:
t.pixelDissolve();
break;
case e.Curtain:
t.curtain();
break;
default:
throw "the type is not exists."
}
},
blindsComplete: function(t) {
if (t.trans.direction == e.OUT) {
t.child.mask.clear()
} else {
t.blindsUpdateRun()
}
t.child.mask = null;
if (t.trans.onComplete) {
t.trans.onComplete(t.child)
}
},
blindsUpdateRun: function() {
var e = this,
t = e.child.mask,
n = LGlobal.canvas;
t.clear();
if (e.trans.dimension) {
t.add(function() {
n.save();
for (var t = 0; t < e.trans.numStrips; t++) {
n.rect(t * e.maxSize, 0, e.blindsSize, e.child.getHeight())
}
n.restore()
})
} else {
t.add(function() {
n.save();
for (var t = 0; t < e.trans.numStrips; t++) {
n.rect(0, 0 + t * e.maxSize, e.child.getWidth(), e.blindsSize)
}
n.restore()
})
}
},
blindsUpdate: function(e) {
e.blindsUpdateRun();
if (e.trans.onUpdate) {
e.trans.onUpdate(e.child)
}
},
blinds: function() {
var t = this;
if (!t.trans.numStrips) t.trans.numStrips = 1;
t.blindsSize = 0;
if (t.trans.dimension) {
t.maxSize = t.child.getWidth() / t.trans.numStrips >> 0
} else {
t.maxSize = t.child.getHeight() / t.trans.numStrips >> 0
}
var n = new LGraphics;
t.child.mask = n;
var r = t.maxSize;
if (t.trans.direction == e.OUT) {
t.blindsSize = t.maxSize;
r = 0
}
LTweenLite.to(t, t.trans.duration, {
blindsSize: r,
onComplete: t.blindsComplete,
onUpdate: t.blindsUpdate,
ease: t.trans.easing
})
},
fadeComplete: function(e) {
e.child.alpha = e.alpha;
if (e.trans.onComplete) {
e.trans.onComplete(e.child)
}
},
fadeUpdate: function(e) {
e.child.alpha = e.alpha;
if (e.trans.onUpdate) {
e.trans.onUpdate(e.child)
}
},
fade: function() {
var t = this;
var n = 1;
t.alpha = 0;
if (t.trans.direction == e.OUT) {
t.alpha = 1;
n = 0
}
t.child.alpha = t.alpha;
LTweenLite.to(t, t.trans.duration, {
alpha: n,
onComplete: t.fadeComplete,
onUpdate: t.fadeUpdate,
ease: t.trans.easing
})
},
flyComplete: function(e) {
e.child.x = e.x;
e.child.y = e.y;
if (e.trans.onComplete) {
e.trans.onComplete(e.child)
}
},
flyUpdate: function(e) {
e.child.x = e.x;
e.child.y = e.y;
if (e.trans.onUpdate) {
e.trans.onUpdate(e.child)
}
},
fly: function() {
var t = this;
var n = t.child.x;
var r = t.child.y;
switch (t.trans.startPoint) {
case 1:
t.x = -t.child.getWidth();
t.y = -t.child.getHeight();
break;
case 2:
t.x = (LGlobal.width - t.child.getWidth()) * .5;
t.y = -t.child.getHeight();
break;
case 3:
t.x = LGlobal.width;
t.y = -t.child.getHeight();
break;
case 4:
t.x = -t.child.getWidth();
t.y = (LGlobal.height - t.child.getHeight()) * .5;
break;
case 6:
t.x = LGlobal.width;
t.y = (LGlobal.height - t.child.getHeight()) * .5;
break;
case 7:
t.x = -t.child.getWidth();
t.y = LGlobal.height;
break;
case 8:
t.x = (LGlobal.width - t.child.getWidth()) * .5;
t.y = LGlobal.height;
break;
case 9:
t.x = LGlobal.width;
t.y = LGlobal.height;
break;
case 5:
default:
t.x = (LGlobal.width - t.child.getWidth()) * .5;
t.y = (LGlobal.height - t.child.getHeight()) * .5
}
if (t.trans.direction == e.OUT) {
var n = t.x;
var r = t.y;
t.x = t.child.x;
t.y = t.child.y
} else {
t.child.x = t.x;
t.child.y = t.y
}
LTweenLite.to(t, t.trans.duration, {
x: n,
y: r,
onComplete: t.flyComplete,
onUpdate: t.flyUpdate,
ease: t.trans.easing
})
},
irisComplete: function(t) {
if (t.trans.direction == e.OUT) {
t.child.mask.clear()
} else {
t.irisUpdateRun()
}
t.child.mask = null;
if (t.trans.onComplete) {
t.trans.onComplete(t.child)
}
},
irisUpdateRun: function() {
var e = this,
t = e.child.mask,
n = LGlobal.canvas;
t.clear();
if (e.trans.shape == LIris.CIRCLE) {
t.drawArc(0, "#000000", [e.x, e.y, e.r, 0, Math.PI * 2])
} else {
t.drawRect(0, "#000000", [e.x + e.sLeft, e.y + e.sTop, e.width, e.height])
}
},
irisUpdate: function(e) {
e.irisUpdateRun();
if (e.trans.onUpdate) {
e.trans.onUpdate(e.child)
}
},
iris: function() {
var t = this;
t.sLeft = 0;
t.sTop = 0;
t.width = 0;
t.height = 0;
t.x = 0;
t.y = 0;
t.r = 0;
t.eWidth = t.child.getWidth();
t.eHeight = t.child.getHeight();
switch (t.trans.startPoint) {
case 1:
t.eR = Math.sqrt(t.eWidth * t.eWidth + t.eHeight * t.eHeight);
break;
case 2:
t.eR = Math.sqrt(t.eWidth * .5 * t.eWidth * .5 + t.eHeight * t.eHeight);
t.x = t.child.getWidth() * .5;
break;
case 3:
t.eR = Math.sqrt(t.eWidth * t.eWidth + t.eHeight * t.eHeight);
t.x = t.child.getWidth();
break;
case 4:
t.eR = Math.sqrt(t.eWidth * t.eWidth + t.eHeight * .5 * t.eHeight * .5);
t.y = t.child.getHeight() * .5;
break;
case 6:
t.eR = Math.sqrt(t.eWidth * t.eWidth + t.eHeight * .5 * t.eHeight * .5);
t.x = t.child.getWidth();
t.y = t.child.getHeight() * .5;
break;
case 7:
t.eR = Math.sqrt(t.eWidth * t.eWidth + t.eHeight * t.eHeight);
t.y = t.child.getHeight();
break;
case 8:
t.eR = Math.sqrt(t.eWidth * .5 * t.eWidth * .5 + t.eHeight * t.eHeight);
t.x = t.child.getWidth() * .5;
t.y = t.child.getHeight();
break;
case 9:
t.eR = Math.sqrt(t.eWidth * t.eWidth + t.eHeight * t.eHeight);
t.x = t.child.getWidth();
t.y = t.child.getHeight();
break;
case 5:
default:
t.eR = Math.sqrt(t.eWidth * .5 * t.eWidth * .5 + t.eHeight * .5 * t.eHeight * .5);
t.x = t.child.getWidth() * .5;
t.y = t.child.getHeight() * .5
}
t.eLeft = -t.x;
t.eTop = -t.y;
var n = new LGraphics;
t.child.mask = n;
var r = t.maxSize;
if (t.trans.direction == e.OUT) {
t.sLeft = t.eLeft;
t.sTop = t.eTop;
t.eLeft = 0;
t.eTop = 0;
t.width = t.eWidth;
t.height = t.eHeight;
t.eWidth = 0;
t.eHeight = 0;
t.r = t.eR;
t.eR = 0
}
LTweenLite.to(t, t.trans.duration, {
width: t.eWidth,
height: t.eHeight,
sLeft: t.eLeft,
sTop: t.eTop,
r: t.eR,
onComplete: t.irisComplete,
onUpdate: t.irisUpdate,
ease: t.trans.easing
})
},
curtainComplete: function(t) {
if (t.trans.direction == e.OUT) {
t.child.mask.clear()
} else {
t.curtainUpdateRun()
}
t.child.mask = null;
if (t.trans.onComplete) {
t.trans.onComplete(t.child)
}
},
curtainUpdateRun: function() {
var e = this,
t = e.child.mask,
n = LGlobal.canvas;
t.clear();
if (e.trans.dimension) {
t.add(function() {
n.save();
n.rect(0, 0, e.width, e.child.getHeight());
n.rect(e.child.getWidth() - e.width, 0, e.width, e.child.getHeight());
n.restore()
})
} else {
t.add(function() {
n.save();
n.rect(0, 0, e.child.getWidth(), e.height);
n.rect(0, e.child.getHeight() - e.height, e.child.getWidth(), e.height);
n.restore()
})
}
},
curtainUpdate: function(e) {
e.curtainUpdateRun();
if (e.trans.onUpdate) {
e.trans.onUpdate(e.child)
}
},
curtain: function() {
var t = this;
var n = t.child.getWidth() * .5;
var r = t.child.getHeight() * .5;
if (t.trans.dimension) {
r = 0
} else {
n = 0
}
t.width = 0;
t.height = 0;
var i = new LGraphics;
t.child.mask = i;
var s = t.maxSize;
if (t.trans.direction == e.OUT) {
t.width = n;
t.height = r;
n = 0;
r = 0
}
LTweenLite.to(t, t.trans.duration, {
width: n,
height: r,
onComplete: t.curtainComplete,
onUpdate: t.curtainUpdate,
ease: t.trans.easing
})
},
squeezeComplete: function(e) {
e.child.scaleX = e.scaleX;
e.child.scaleY = e.scaleY;
if (e.trans.onComplete) {
e.trans.onComplete(e.child)
}
},
squeezeUpdate: function(e) {
e.child.scaleX = e.scaleX;
e.child.scaleY = e.scaleY;
if (e.trans.onUpdate) {
e.trans.onUpdate(e.child)
}
},
squeeze: function() {
var t = this;
var n = 1,
r = 1;
t.scaleX = 0, t.scaleY = 0;
if (t.trans.dimension) {
t.scaleX = 1
} else {
t.scaleY = 1
} if (t.trans.direction == e.OUT) {
n = t.scaleX, r = t.scaleY;
t.scaleX = 1, t.scaleY = 1
}
t.child.scaleX = t.scaleX;
t.child.scaleY = t.scaleY;
LTweenLite.to(t, t.trans.duration, {
scaleX: n,
scaleY: r,
onComplete: t.squeezeComplete,
onUpdate: t.squeezeUpdate,
ease: t.trans.easing
})
},
zoomComplete: function(e) {
e.child.scaleX = e.scaleX;
e.child.scaleY = e.scaleY;
if (e.trans.onComplete) {
e.trans.onComplete(e.child)
}
},
zoomUpdate: function(e) {
e.child.scaleX = e.scaleX;
e.child.scaleY = e.scaleY;
if (e.trans.onUpdate) {
e.trans.onUpdate(e.child)
}
},
zoom: function() {
var t = this;
var n = 1,
r = 1;
t.scaleX = 0, t.scaleY = 0;
if (t.trans.direction == e.OUT) {
n = 0, r = 0;
t.scaleX = 1, t.scaleY = 1
}
t.child.scaleX = t.scaleX;
t.child.scaleY = t.scaleY;
LTweenLite.to(t, t.trans.duration, {
scaleX: n,
scaleY: r,
onComplete: t.zoomComplete,
onUpdate: t.zoomUpdate,
ease: t.trans.easing
})
},
wipeComplete: function(t) {
if (t.trans.direction == e.OUT) {
t.child.mask.clear()
} else {
t.wipeUpdateRun()
}
t.child.mask = null;
if (t.trans.onComplete) {
t.trans.onComplete(t.child)
}
},
wipeUpdateRun: function() {
var e = this,
t = e.child.mask,
n = LGlobal.canvas;
t.clear();
t.drawVertices(0, "#000000", [
[e.leftTopX, e.leftTopY],
[e.leftBottomX, e.leftBottomY],
[e.rightBottomX, e.rightBottomY],
[e.rightTopX, e.rightTopY]
])
},
wipeUpdate: function(e) {
e.wipeUpdateRun();
if (e.trans.onUpdate) {
e.trans.onUpdate(e.child)
}
},
wipe: function() {
var t = this,
n = t.child.getWidth(),
r = t.child.getHeight(),
i = t.leftTopX = 0,
s = t.leftTopY = 0,
o = t.leftBottomX = 0,
u = t.leftBottomY = r,
a = t.rightTopX = n,
f = t.rightTopY = 0,
l = t.rightBottomX = n,
c = t.rightBottomY = r;
switch (t.trans.startPoint) {
case 1:
i = t.leftTopX = -n;
o = t.leftBottomX = -n * 2;
t.rightTopX = 0;
a = n * 2;
t.rightBottomX = -n;
l = n;
break;
case 2:
s = t.leftTopY = -r;
t.leftBottomY = 0;
u = r;
f = t.rightTopY = -r;
t.rightBottomY = 0;
c = r;
break;
case 3:
t.leftTopX = n;
i = -n;
t.leftBottomX = n * 2;
o = 0;
a = t.rightTopX = n * 2;
l = t.rightBottomX = n * 3;
break;
case 4:
t.rightTopX = 0;
a = n;
t.rightBottomX = 0;
l = n;
break;
case 6:
t.leftTopX = n;
i = 0;
t.leftBottomX = n;
o = 0;
break;
case 7:
o = t.leftBottomX = -n;
i = t.leftTopX = -n * 2;
t.rightBottomX = 0;
l = n * 2;
t.rightTopX = -n;
a = n;
break;
case 8:
u = t.leftBottomY = r;
t.leftTopY = r;
s = 0;
c = t.rightBottomY = r;
t.rightTopY = r;
f = 0;
break;
case 9:
t.leftBottomX = n;
o = -n;
t.leftTopX = n * 2;
i = 0;
l = t.rightBottomX = n * 2;
a = t.rightTopX = n * 3;
break;
case 5:
default:
t.leftTopX = n * .5;
t.leftTopY = r * .5;
t.rightTopX = n * .5;
t.rightTopY = r * .5;
t.leftBottomX = n * .5;
t.leftBottomY = r * .5;
t.rightBottomX = n * .5;
t.rightBottomY = r * .5;
i = 0, s = 0;
o = 0, u = r;
a = n, f = 0;
l = n, c = r
}
var h = new LGraphics;
t.child.mask = h;
if (t.trans.direction == e.OUT) {
var p = i,
d = s,
v = o,
m = u,
g = a,
y = f,
b = l,
w = c;
i = t.leftTopX, s = t.leftTopY, o = t.leftBottomX, u = t.leftBottomY, a = t.rightTopX, f = t.rightTopY, l = t.rightBottomX, c = t.rightBottomY;
t.leftTopX = p, t.leftTopY = d, t.leftBottomX = v, t.leftBottomY = m, t.rightTopX = g, t.rightTopY = y, t.rightBottomX = b, t.rightBottomY = w
}
LTweenLite.to(t, t.trans.duration, {
leftTopX: i,
leftTopY: s,
leftBottomX: o,
leftBottomY: u,
rightTopX: a,
rightTopY: f,
rightBottomX: l,
rightBottomY: c,
onComplete: t.wipeComplete,
onUpdate: t.wipeUpdate,
ease: t.trans.easing
})
},
pixelDissolveComplete: function(t) {
if (t.trans.direction == e.OUT) {
t.child.mask.clear()
} else {
t.pixelDissolveUpdateRun()
}
t.child.mask = null;
if (t.trans.onComplete) {
t.trans.onComplete(t.child)
}
},
pixelDissolveUpdateRun: function() {
var e = this,
t = e.child.mask,
n = LGlobal.canvas,
r;
t.clear();
t.add(function() {
n.save();
for (var t = 0; t < e.index; t++) {
r = e.list[t];
n.rect(r[0] * e.w, r[1] * e.h, e.w, e.h)
}
n.restore()
})
},
pixelDissolveUpdate: function(e) {
e.pixelDissolveUpdateRun();
if (e.trans.onUpdate) {
e.trans.onUpdate(e.child)
}
},
pixelDissolve: function() {
var t = this;
var n = new LGraphics;
t.child.mask = n;
LGlobal.mg = n;
t.w = t.child.getWidth() / t.trans.xSections, t.h = t.child.getHeight() / t.trans.ySections;
t.list = [];
for (var r = 0; r < t.trans.xSections; r++) {
for (var i = 0; i < t.trans.ySections; i++) {
t.list.push([r, i])
}
}
t.index = 0;
var s = t.trans.xSections * t.trans.ySections;
if (t.trans.direction == e.OUT) {
t.index = s;
s = 0
}
t.list = t.list.sort(function(e, t) {
return Math.random() > .5
});
t.pixelDissolveUpdateRun();
LTweenLite.to(t, t.trans.duration, {
index: s,
onComplete: t.pixelDissolveComplete,
onUpdate: t.pixelDissolveUpdate,
ease: t.trans.easing
})
}
};
e.IN = "in";
e.OUT = "out";
e.Blinds = 1;
e.Fade = 2;
e.Fly = 3;
e.Iris = 4;
e.Curtain = 5;
e.PixelDissolve = 6;
e.Squeeze = 7;
e.Wipe = 8;
e.Zoom = 9;
return e
}();
var LIris = function() {
function e() {}
e.SQUARE = 0;
e.CIRCLE = 1;
return e
}();
var LTransitionManager = function() {
function e(e) {
this.child = e
}
e.prototype = {
startTransition: function(t) {
return e.start(this.child, t)
}
};
e.start = function(e, t) {
var n = new LTransition(e, t);
n.startTransition();
return n
};
return e
}();
var LFlash = function() {
function e() {}
e.SpriteSheetConvert = function(e) {
var t = [],
n;
for (var r = 0; r < e.length; r++) {
n = e[r];
t.push({
x: n.frame.x,
sx: n.spriteSourceSize.x,
y: n.frame.y,
sy: n.spriteSourceSize.y,
width: n.frame.w,
height: n.frame.h
})
}
return t
};
return e
}();
var LString = {
trim: function(e) {
return e.replace(/(^\s*)|(\s*$)|(\n)/g, "")
},
leftTrim: function(e) {
return e.replace(/(^\s*)|(^\n)/g, "")
},
rightTrim: function(e) {
return e.replace(/(\s*$)|(\n$)/g, "")
},
numberFormat: function(e, t) {
if (!t || t < 1) {
t = 3
}
e = String(e).split(".");
e[0] = e[0].replace(new RegExp("(\\d)(?=(\\d{" + t + "})+$)", "ig"), "$1,");
return e.join(".")
},
isString: function(e) {
var t = /^([a-z]|[A-Z])+$/;
return t.exec(e)
},
isNumber: function(e) {
var t = /^\d+\.\d+$/;
return t.exec(e)
},
isInt: function(e) {
var t = /^\d+$/;
return t.exec(e)
}
};
LMath = LString