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;function LEvent(type){this.eventType=type;this._ll_preventDefault=false}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(n,t,f,b){if(b==null){b=false}if(n.addEventListener){n.addEventListener(t,f,b)}else{if(n.attachEvent){n["e"+t+f]=f;n[t+f]=function(){n["e"+t+f]()};n.attachEvent("on"+t,n[t+f])}}};LEvent.removeEventListener=function(n,t,f,b){if(b==null){b=false}if(n.removeEventListener){n.removeEventListener(t,f,b)}else{if(n.detachEvent){n["e"+t+f]=f;n[t+f]=function(){n["e"+t+f]()};n.detachEvent("on"+t,n[t+f])}}};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 MouseEventContainer(){var s=this;s.container={};s.dispatchAllEvent=false;s.mouseDownContainer=[];s.mouseUpContainer=[];s.mouseMoveContainer=[];s.mouseOverContainer=[];s.mouseOutContainer=[];s.mouseDblContainer=[];s.textFieldInputContainer=[];s.buttonContainer=[]}MouseEventContainer.prototype={pushInputBox:function(d){var s=this,c=s.textFieldInputContainer,i,l;for(i=0,l=c.length;i1){st=st.sort(self._sort.bind(self))}l=st.length;for(i=0;i=0);if(n.indexOf(OS_IPHONE)>0){LGlobal.os=OS_IPHONE;LGlobal.canTouch=true;LGlobal.ios=true}else{if(n.indexOf(OS_IPOD)>0){LGlobal.os=OS_IPOD;LGlobal.canTouch=true;LGlobal.ios=true}else{if(n.indexOf(OS_IPAD)>0){LGlobal.os=OS_IPAD;LGlobal.ios=true;LGlobal.canTouch=true}else{if(n.indexOf(OS_ANDROID)>0){LGlobal.os=OS_ANDROID;LGlobal.canTouch=true;LGlobal.android=true;var i=n.indexOf(OS_ANDROID);if(parseInt(n.substr(i+8,1))>3){LGlobal.android_new=true}}else{if(n.indexOf(OS_WINDOWS_PHONE)>0){LGlobal.os=OS_WINDOWS_PHONE;LGlobal.canTouch=true}else{if(n.indexOf(OS_BLACK_BERRY)>0){LGlobal.os=OS_BLACK_BERRY;LGlobal.canTouch=true}}}}}}LGlobal.mobile=LGlobal.canTouch})(navigator.userAgent);LGlobal.setDebug=function(v){LGlobal.traceDebug=v};LGlobal.setCanvas=function(id,w,h){LGlobal.ll_createCanvas(id,w,h);LGlobal.ll_createStage();if(LGlobal.displayState==LStage.FULL_SCREEN){LGlobal.resize()}else{if(typeof LGlobal.displayState=="number"){LGlobal.resize(LGlobal.width*LGlobal.displayState,LGlobal.height*LGlobal.displayState)}}if(LGlobal.canTouch){LGlobal.ll_clicks=0;LGlobal.ll_prev_clickTime=0;LEvent.addEventListener(LGlobal.canvasObj,LMouseEvent.TOUCH_START,LGlobal.ll_touchStart);LEvent.addEventListener(document,LMouseEvent.TOUCH_END,LGlobal.ll_touchEnd);LEvent.addEventListener(LGlobal.canvasObj,LMouseEvent.TOUCH_MOVE,LGlobal.ll_touchMove)}else{LEvent.addEventListener(LGlobal.canvasObj,LMouseEvent.DOUBLE_CLICK,LGlobal.ll_mouseDbclick);LEvent.addEventListener(LGlobal.canvasObj,LMouseEvent.MOUSE_DOWN,LGlobal.ll_mouseDown);LEvent.addEventListener(LGlobal.canvasObj,LMouseEvent.MOUSE_MOVE,LGlobal.ll_mouseMove);LEvent.addEventListener(LGlobal.canvasObj,LMouseEvent.MOUSE_UP,LGlobal.ll_mouseUp);LEvent.addEventListener(LGlobal.canvasObj,LMouseEvent.MOUSE_OUT,LGlobal.ll_mouseOut)}};LGlobal.ll_createCanvas=function(id,w,h){LGlobal.id=id;LGlobal.object=document.getElementById(id);LGlobal.object.innerHTML='
'+''+'
'+"

Hey there,it looks like you're using Microsoft's Internet Explorer. Microsoft hates the Web and doesn't support HTML5:(

"+"
"+"
"+'';LGlobal.canvasObj=document.getElementById(LGlobal.id+"_canvas");LGlobal._canvas=document.createElement("canvas");LGlobal._context=LGlobal._canvas.getContext("2d");if(LGlobal._context){LGlobal.canvasObj.innerHTML=""}LGlobal.inputBox=document.getElementById(LGlobal.id+"_InputText");LGlobal.inputTextareaBoxObj=document.getElementById(LGlobal.id+"_InputTextareaBox");LGlobal.inputTextBoxObj=document.getElementById(LGlobal.id+"_InputTextBox");LGlobal.passwordBoxObj=document.getElementById(LGlobal.id+"_passwordBox");LGlobal.inputTextField=null;if(w){LGlobal.canvasObj.width=w}if(h){LGlobal.canvasObj.height=h}LGlobal.width=LGlobal.canvasObj.width;LGlobal.height=LGlobal.canvasObj.height;LGlobal.canvasStyleWidth=LGlobal.width;LGlobal.canvasStyleHeight=LGlobal.height;LGlobal.canvas=LGlobal.canvasObj.getContext("2d");LGlobal.offsetX=mouseX=0;LGlobal.offsetY=mouseY=0};LGlobal.ll_createStage=function(){LGlobal.stage=new LSprite();LGlobal.stage.parent="root";LGlobal.childList.push(LGlobal.stage);LGlobal.stage.baseAddEvent=LGlobal.stage.addEventListener;LGlobal.stage.baseRemoveEvent=LGlobal.stage.removeEventListener;LGlobal.stage.addEventListener=function(type,listener){if(type==LEvent.WINDOW_RESIZE){LGlobal.stage.onresizeListener=listener;LGlobal.stage.onresize=function(e){LGlobal.stage.onresizeEvent=e};LEvent.addEventListener(LGlobal.window,type,LGlobal.stage.onresize)}else{if(type==LKeyboardEvent.KEY_DOWN||type==LKeyboardEvent.KEY_UP||type==LKeyboardEvent.KEY_PRESS){LEvent.addEventListener(LGlobal.window,type,listener)}else{LGlobal.stage.baseAddEvent(type,listener)}}};LGlobal.stage.removeEventListener=function(type,listener){if(type==LEvent.WINDOW_RESIZE){LEvent.removeEventListener(LGlobal.window,LEvent.WINDOW_RESIZE,LGlobal.stage.onresize); delete LGlobal.stage.onresize;delete LGlobal.stage.onresizeListener}else{if(type==LKeyboardEvent.KEY_DOWN||type==LKeyboardEvent.KEY_UP||type==LKeyboardEvent.KEY_PRESS){LEvent.removeEventListener(LGlobal.window,type,listener)}else{LGlobal.stage.baseRemoveEvent(type,listener)}}}};LGlobal.ll_touchStart=function(event){if(LGlobal.inputBox.style.display!=NONE){LGlobal.inputTextField._ll_getValue()}var canvasX,canvasY,eve,k,i;canvasX=parseInt(0+LGlobal.object.style.left)+parseInt(LGlobal.canvasObj.style.marginLeft);canvasY=parseInt(0+LGlobal.object.style.top)+parseInt(LGlobal.canvasObj.style.marginTop);if(LMultitouch.inputMode==LMultitouchInputMode.NONE){eve=LGlobal.ll_touchStartEvent(event,0,canvasX,canvasY)}else{if(LMultitouch.inputMode==LMultitouchInputMode.TOUCH_POINT){for(var i=0,l=event.touches.length;i=0;k--){if(LGlobal.childList[k].mouseEvent&&LGlobal.childList[k].mouseEvent(e,t)){break}}};LGlobal.dragHandler=function(e){var i,s,c,d=LGlobal.dragList;for(i=d.length-1;i>=0;i--){s=d[i];if(LGlobal.canTouch&&s.ll_touchPointID!=e.touchPointID){continue}c=s.getAbsoluteScale();s.x=s.ll_dragStartX+(e.offsetX-s.ll_dragMX)*s.scaleX/c.scaleX;s.y=s.ll_dragStartY+(e.offsetY-s.ll_dragMY)*s.scaleY/c.scaleY;if(s.dragRange){if(s.xs.dragRange.right){s.x=s.dragRange.right}}if(s.ys.dragRange.bottom){s.y=s.dragRange.bottom}}}break}};LGlobal._ll_mobile=function(){var w1=LGlobal.width*0.3,h1=w1*1.5,s=LGlobal.width*0.05,ss=w1*0.05,sm=w1*0.15,sx=w1*0.3,sh=h1*0.2,c="#cccccc",d="#000000",f="#ffffff",h="#ff0000",b,w1,h1,m,m1,n,v;b=new LSprite();addChild(b);w1=LGlobal.width*0.3,h1=w1*1.5;b.graphics.drawRoundRect(1,d,[s,s,w1,h1,s],true,c);b.graphics.drawRoundRect(1,d,[s+ss,s+ss,w1-ss*2,h1-ss*2,s],true,d);b.graphics.drawRect(1,f,[s+sm,s+sh,w1-sm*2,h1-sh*2],true,f);b.graphics.drawArc(1,f,[s+w1*0.5,s+h1-ss*3.5,ss*1.5,0,2*Math.PI]);b.graphics.drawRoundRect(1,f,[s+sx,s+sm,w1-sx*2,ss,ss*0.5]);m=new LSprite();m.x=-(w1-sm*2)*0.5;m.y=-ss*0.5;m.graphics.drawRect(1,h,[0,0,w1-sm*2,ss],true,h);m1=new LSprite();m1.y=-(w1-sm*2)*0.5;m1.x=-ss*0.5;m1.graphics.drawRect(1,h,[0,0,ss,w1-sm*2],true,h);n=new LSprite();n.x=s+sx+(w1-sx*2)*0.5;n.y=s+sh+(h1-sh*2)*0.5;n.rotate=45;n.addChild(m);n.addChild(m1);b.addChild(n);v=new LSprite();v.graphics.drawVertices(2,d,[[0,0],[sm,sm],[0,sm*2]],true,c);v.x=s*1.5+h1;v.y=s*1.5+h1*0.5;addChild(v);b.arrow=v;var fn=function(){setTimeout(function(){location.href=location.href},100)};window.onorientationchange=fn;return b};LGlobal.verticalError=function(){var w1=LGlobal.width*0.3,s=LGlobal.width*0.05;var b=LGlobal._ll_mobile();var d=b.clone();d.getChildAt(0).visible=false;d.x=LGlobal.width*0.5+s;addChild(d);b.rotate=90;b.x=LGlobal.width*0.5+s;b.y=w1*0.5};LGlobal.horizontalError=function(){var w1=LGlobal.width*0.3,s=LGlobal.width*0.05;var b=LGlobal._ll_mobile();var d=b.clone();d.getChildAt(0).visible=false;d.rotate=90;d.x=LGlobal.width-s;d.y=w1*0.5;addChild(d);b.arrow.x=s*1.5+w1};LGlobal.onShow=function(){if(LGlobal.canvas==null){return}if(LGlobal.fpsStatus){LGlobal.fpsStatus.reset()}if(LGlobal.stage.onresizeEvent){LGlobal.stage.onresizeListener(LGlobal.stage.onresizeEvent);delete LGlobal.stage.onresizeEvent}if(LGlobal.forceRefresh){LGlobal.canvasObj.width=LGlobal.canvasObj.width;LGlobal.forceRefresh=false}LGlobal.canvas.beginPath();if(LGlobal.box2d!=null){LGlobal.box2d.ll_show();if(!LGlobal.traceDebug&&LGlobal.keepClear){LGlobal.canvas.clearRect(0,0,LGlobal.width+1,LGlobal.height+1)}}else{if(LGlobal.keepClear){LGlobal.canvas.clearRect(0,0,LGlobal.width+1,LGlobal.height+1)}if(LGlobal.backgroundColor!==null){LGlobal.canvas.fillStyle=LGlobal.backgroundColor;LGlobal.canvas.fillRect(0,0,LGlobal.width,LGlobal.height)}}LGlobal.show(LGlobal.childList)};LGlobal.show=function(s){for(var i=0,l=s.length,c;ir2.max_o){return false}}}return true};LGlobal.hitTestPolygonArc=function(vs,arc){if(LGlobal.hitPolygon(vs,arc[0],arc[1])){return true}var i,j,l,p1,p2,v1,v2,ext,inn,l2;for(i=0,l=vs.length;ixB?xA:xB,miny=yA>yB?yA:yB,maxx=(xA+wA)>(xB+wB)?(xB+wB):(xA+wA),maxy=(yA+hA)>(yB+hB)?(yB+hB):(yA+hA);return minx<=maxx&&miny<=maxy};LGlobal.hitTest=LGlobal.hitTestRect;LGlobal.setFrameRate=function(s){if(LGlobal.frameRate){clearInterval(LGlobal.frameRate)}LGlobal.speed=s;LGlobal.frameRate=setInterval(function(){LGlobal.onShow()},s)};LGlobal.ll_scaleX=function(v){return(v-LGlobal.left)*LGlobal.width/LGlobal.canvasStyleWidth};LGlobal.ll_scaleY=function(v){return(v-LGlobal.top)*LGlobal.height/LGlobal.canvasStyleHeight};LGlobal.ll_setStageSize=function(w,h){w=Math.ceil(w);h=Math.ceil(h);LGlobal.canvasObj.style.width=w+"px";LGlobal.canvasObj.style.height=h+"px";LGlobal.canvasStyleWidth=w;LGlobal.canvasStyleHeight=h};LGlobal.resize=function(canvasW,canvasH){var w,h,t=0,l=0,ww=window.innerWidth,wh=window.innerHeight;if(canvasW){w=canvasW}if(canvasH){h=canvasH}if(LGlobal.stageScale=="noScale"){w=canvasW||LGlobal.width;h=canvasH||LGlobal.height}switch(LGlobal.stageScale){case"exactFit":w=canvasW||ww;h=canvasH||wh;break;case"noBorder":w=canvasW||ww;h=canvasH||LGlobal.height*ww/LGlobal.width;switch(LGlobal.align){case LStageAlign.BOTTOM:case LStageAlign.BOTTOM_LEFT:case LStageAlign.BOTTOM_RIGHT:case LStageAlign.BOTTOM_MIDDLE:t=wh-h;break}break;case"showAll":if(ww/wh>LGlobal.width/LGlobal.height){h=canvasH||wh;w=canvasW||LGlobal.width*wh/LGlobal.height}else{w=canvasW||ww;h=canvasH||LGlobal.height*ww/LGlobal.width}case"noScale":default:switch(LGlobal.align){case LStageAlign.BOTTOM:case LStageAlign.BOTTOM_LEFT:t=wh-h;break;case LStageAlign.RIGHT:case LStageAlign.TOP_RIGHT:l=ww-w;break;case LStageAlign.TOP_MIDDLE:l=(ww-w)*0.5;break;case LStageAlign.BOTTOM_RIGHT:t=wh-h;l=ww-w;break;case LStageAlign.BOTTOM_MIDDLE:t=wh-h;l=(ww-w)*0.5;break;case LStageAlign.MIDDLE:t=(wh-h)*0.5;l=(ww-w)*0.5;break;case LStageAlign.TOP:case LStageAlign.LEFT:case LStageAlign.TOP_LEFT:default:}}LGlobal.canvasObj.style.marginTop=t+"px";LGlobal.canvasObj.style.marginLeft=l+"px";if(LGlobal.isFirefox){LGlobal.left=parseInt(LGlobal.canvasObj.style.marginLeft);LGlobal.top=parseInt(LGlobal.canvasObj.style.marginTop)}LGlobal.ll_setStageSize(w,h)};LGlobal.sleep=function(s){var d=new Date();while((new Date().getTime()-d.getTime())>>0;var from=Number(arguments[1])||0;from=(from<0)?Math.ceil(from):Math.floor(from);if(from<0){from+=len}for(;from>>0;var thisArg=arguments[1];var value;for(var i=0;i>>0;var thisArg=arguments[1];var value;for(var i=0;i>>0;if(typeof callback!=="function"){throw new TypeError(callback+" is not a function")}if(arguments.length>1){T=thisArg}k=0;while(k>>0;if(typeof callbackfn!=="function"){throw new TypeError()}if(arguments.length>1){T=thisArg}k=0;while(k>>0;var thisArg=arguments.length>=2?arguments[1]:void 0;for(var i=0;i0&&t==null){t=document.createElement("TEXTAREA");t.id="traceObject";t.style.position="absolute";t.style.top=(LGlobal.height+20)+"px";t.style.width=LGlobal.width+"px";t.style.height="200px";document.body.appendChild(t)}for(i=0;iwindow.innerHeight){LGlobal.verticalError()}else{setTimeout(f,100)}}LGlobal.startTimer=(new Date()).getTime()};if(t!=null&&t==LEvent.INIT){LGlobal.frameRate=setInterval(function(){LGlobal.onShow()},s);LGlobal.setCanvas(c,w,h);_f()}else{LEvent.addEventListener(window,"load",function(){LGlobal.frameRate=setInterval(function(){LGlobal.onShow()},s);LGlobal.setCanvas(c,w,h);_f()})}}var LInit=init;function base(d,b,a){var p=null,o=d.constructor.prototype,h={};if(d.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 d.__ll__parent__==UNDEFINED){d.__ll__parent__=[];d.__ll__parent__=[]}d.__ll__parent__.push(b.prototype);for(p in o){h[p]=1}for(p in b.prototype){if(!h[p]){o[p]=b.prototype[p]}}if(o.toString==Object.prototype.toString){o.toString=LObject.prototype.toString}b.apply(d,a)}var LExtends=base;function getTimer(){return(new Date()).getTime()-LGlobal.startTimer}function getExtension(path){var r,pattern=/([^#?]+\.)([^.#?]+)/;r=path.match(pattern);if(r.length>=3){return r[2].toLowerCase()}return null}var LObject=(function(){function LObject(){this.type="LObject";this.objectIndex=++LGlobal.objectIndex;this.objectindex=this.objectIndex}LObject.prototype={callParent:function(f_n,args){if(!f_n||!args){return}var s=this,init=false,r,k="__ll__parent_call"+f_n;if(typeof s[k]=="undefined"){init=true;s[k]=0}else{s[k]++}if(s[k]>=s.__ll__parent__.length){return false}if(!s.__ll__parent__[s[k]][f_n]){r=s.callParent(f_n,args)}else{r=s.__ll__parent__[s[k]][f_n].apply(s,args)}if(init){delete s[k]}return r},toString:function(){return"[object "+this.constructor.name+"]"}};return LObject})();var LColorTransform=(function(){function LColorTransform(redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier,redOffset,greenOffset,blueOffset,alphaOffset){var s=this;LExtends(s,LObject,[]);s.redMultiplier=redMultiplier;s.greenMultiplier=greenMultiplier;s.blueMultiplier=blueMultiplier; s.alphaMultiplier=alphaMultiplier;s.redOffset=redOffset;s.greenOffset=greenOffset;s.blueOffset=blueOffset;s.alphaOffset=alphaOffset}return LColorTransform})();var LTransform=(function(){function LTransform(){var s=this;LExtends(s,LObject,[]);s.matrix=null}return LTransform})();var LMatrix=(function(){function LMatrix(a,b,c,d,tx,ty,u,v,w){var s=this;LExtends(s,LObject,[]);s.a=1;s.b=0;s.u=0;s.c=0;s.d=1;s.v=0;s.tx=0;s.ty=0;s.w=1;if(typeof a!=UNDEFINED){s.a=a}if(typeof b!=UNDEFINED){s.b=b}if(typeof c!=UNDEFINED){s.c=c}if(typeof d!=UNDEFINED){s.d=d}if(typeof tx!=UNDEFINED){s.tx=tx}if(typeof ty!=UNDEFINED){s.ty=ty}if(typeof u!=UNDEFINED){s.u=u}if(typeof v!=UNDEFINED){s.v=v}if(typeof w!=UNDEFINED){s.w=w}}var p={setTo:function(a,b,c,d,tx,ty,u,v,w){var s=this;if(typeof a!=UNDEFINED){s.a=a}if(typeof b!=UNDEFINED){s.b=b}if(typeof c!=UNDEFINED){s.c=c}if(typeof d!=UNDEFINED){s.d=d}if(typeof tx!=UNDEFINED){s.tx=tx}if(typeof ty!=UNDEFINED){s.ty=ty}if(typeof u!=UNDEFINED){s.u=u}if(typeof v!=UNDEFINED){s.v=v}if(typeof w!=UNDEFINED){s.w=w}return s},isIdentity:function(){var s=this;return(s.a==1&&s.b==0&&s.c==0&&s.d==1&&s.tx==0&&s.ty==0&&u==0&&v==0&&w==1)},transform:function(c){var s=this;c.transform(s.a,s.b,s.c,s.d,s.tx,s.ty);return s},identity:function(){this.setTo(1,0,0,1,0,0,0,0,1)},rotate:function(q){var s=this,radian=q*Math.PI/180,cos=Math.cos(radian),sin=Math.sin(radian),mtx=new LMatrix(cos,sin,-sin,cos,0,0,0,0,1);s.add(mtx);return s},scale:function(sx,sy){var s=this,mtx=new LMatrix(sx,0,0,sy,0,0,0,0,1);s.add(mtx);return s},translate:function(tx,ty){var s=this,mtx=new LMatrix(1,0,0,1,tx,ty,0,0,1);s.add(mtx);return s},skew:function(kx,ky){var s=this,mtx=new LMatrix(1,ky,kx,1,0,0,0,0,1);s.add(mtx);return s},add:function(mtx){var s=this,a,b,c,d,tx,ty,u,v,w;a=s.a*mtx.a+s.b*mtx.c+s.u*mtx.tx;b=s.a*mtx.b+s.b*mtx.d+s.u*mtx.ty;u=s.a*mtx.u+s.b*mtx.v+s.u*mtx.w;c=s.c*mtx.a+s.d*mtx.c+s.v*mtx.tx;d=s.c*mtx.b+s.d*mtx.d+s.v*mtx.ty;v=s.c*mtx.u+s.d*mtx.v+s.v*mtx.w;tx=s.tx*mtx.a+s.ty*mtx.c+s.w*mtx.tx;ty=s.tx*mtx.b+s.ty*mtx.d+s.w*mtx.ty;w=s.tx*mtx.u+s.ty*mtx.v+s.w*mtx.w;s.setTo(a,b,c,d,tx,ty,u,v,w)},toArray:function(mtx){var s=this;if(Array.isArray(mtx)&&mtx.length==3){var m=mtx[0]*s.a+mtx[1]*s.c+mtx[2]*s.tx,n=mtx[0]*s.b+mtx[1]*s.d+mtx[2]*s.ty,k=mtx[0]*s.u+mtx[1]*s.v+mtx[2]*s.w;return[m,n,k]}else{var a=s.a*mtx.a+s.b*mtx.c+s.u*mtx.tx,b=s.a*mtx.b+s.b*mtx.d+s.u*mtx.ty,u=s.a*mtx.u+s.b*mtx.v+s.u*mtx.w,c=s.c*mtx.a+s.d*mtx.c+s.v*mtx.tx,d=s.c*mtx.b+s.d*mtx.d+s.v*mtx.ty,v=s.c*mtx.u+s.d*mtx.v+s.v*mtx.w,tx=s.tx*mtx.a+s.ty*mtx.c+s.w*mtx.tx,ty=s.tx*mtx.b+s.ty*mtx.d+s.w*mtx.ty,w=s.tx*mtx.u+s.ty*mtx.v+s.w*mtx.w;return[a,b,c,d,tx,ty,u,v,w]}},clone:function(){var s=this;return new LMatrix(s.a,s.b,s.c,s.d,s.tx,s.ty,s.u,s.v,s.w)}};for(var k in p){LMatrix.prototype[k]=p[k]}return LMatrix})();var LVec2=(function(){function LVec2(x,y){this.x=x||0;this.y=y||0}LVec2.dot=function(a,b){return a.x*b.x+a.y*b.y};LVec2.cross=function(a,b){return a.x*b.y-a.y*b.x};LVec2.distance=function(a,b){var x=a.x-b.x;var y=a.y-b.y;return Math.sqrt(x*x+y*y)};LVec2.getMinMax=function(vecs,axis){var min_o=LVec2.dot(vecs[0],axis);var max_o=LVec2.dot(vecs[0],axis);var min_i=0;var max_i=0;for(var i=1;ithis_o){min_o=this_o;min_i=i}if(max_o=0;j--){child=shapes[j];arg=child.arg;v=s._changeShape(child.type,arg,m);if(child.type==LShape.VERTICES){if(LGlobal.hitPolygon(v,mx,my)){return true}}else{if(child.type==LShape.RECT){if(LGlobal.hitPolygon(v,mx,my)){return true}}else{if(child.type==LShape.ARC){if((v[0]-mx)*(v[0]-mx)+(v[1]-my)*(v[1]-my)=0||type.indexOf("touch")>=0||type==LMouseEvent.DOUBLE_CLICK){if(LMouseEventContainer.container[type]||((type==LMouseEvent.MOUSE_OVER||type==LMouseEvent.MOUSE_OUT)&&LMouseEventContainer.container[LMouseEvent.MOUSE_MOVE])){LMouseEventContainer.addMouseEvent(s,type,listener);return}s.mouseList.push({listener:listener,type:type})}else{s._eventList.push({listener:listener,type:type})}},removeEventListener:function(type,listener){var s=this,i,length;if(type.indexOf("mouse")>=0||type.indexOf("touch")>=0||type==LMouseEvent.DOUBLE_CLICK){if(LMouseEventContainer.container[type]||((type==LMouseEvent.MOUSE_OVER||type==LMouseEvent.MOUSE_OUT)&&LMouseEventContainer.container[LMouseEvent.MOUSE_MOVE])){LMouseEventContainer.removeMouseEvent(s,type,listener);return}length=s.mouseList.length;for(i=0;i=0||type.indexOf("touch")>=0||type==LMouseEvent.DOUBLE_CLICK){length=s.mouseList.length;for(i=0;is.childList.length){return}if(typeof d.remove=="function"){t=LGlobal.destroy;LGlobal.destroy=false;d.remove();LGlobal.destroy=t}d.parent=s;s.childList.splice(i,0,d);s.numChildren=s.childList.length;s._ll_removeFromSelf=false;return d},removeChild:function(d){var s=this,c=s.childList,i,l;for(i=0,l=c.length;i=l){return -1}for(i=0;i0){data=LWebAudio.container.shift()}else{if(typeof webkitAudioContext!==UNDEFINED){try{data=new webkitAudioContext()}catch(e){LWebAudio.containerCount=LWebAudio.container.length;data=LWebAudio.container.shift()}}else{if(typeof AudioContext!==UNDEFINED){try{data=new AudioContext()}catch(e){LWebAudio.containerCount=LWebAudio.container.length;data=LWebAudio.container.shift()}}else{throw"AudioContext not supported.:("}}}if(!data.createGainNode){data.createGainNode=data.createGain}LWebAudio.container.push(data);return data},onload:function(data){var s=this;if(Object.prototype.toString.apply(data)!=="[object AudioBuffer]"){s.load(data);return}if(!s.data){s.data=s.getWebAudio()}s.buffer=data;s.length=s.buffer.duration;var e=new LEvent(LEvent.COMPLETE);e.currentTarget=s;e.target=s.buffer;s.dispatchEvent(e)},_onended:function(){var s=this;s.dispatchEvent(LEvent.SOUND_COMPLETE);s.close();if(++s.loopIndexs.length?s.length:to}else{s.currentTimeTo=s.length}s.data.loop=false;s.playing=true;if(s.timeout){clearTimeout(s.timeout);delete s.timeout}s.timeout=setTimeout(s._onended.bind(s),(s.currentTimeTo-s.currentTime)*1000);s.bufferSource=s.data.createBufferSource();s.bufferSource.buffer=s.buffer;s.volumeNode=s.data.createGainNode();s.volumeNode.gain.value=s.volume;s.volumeNode.connect(s.data.destination);s.bufferSource.connect(s.volumeNode);s.currentSave=s.data.currentTime;if(s.bufferSource.start){s.bufferSource.start(0,s.currentTime,s.length-s.currentTime)}else{s.bufferSource.noteGrainOn(0,s.currentTime,s.length-s.currentTime)}},playSegment:function(c,seg,l){this.playTo(c,c+seg,l)},playTo:function(c,to,l){this.play(c,l,to)},stop:function(){var s=this;if(!s.playing){return}if(s.timeout){clearTimeout(s.timeout);delete s.timeout}if(s.bufferSource.stop){s.bufferSource.stop(0)}else{s.bufferSource.noteOff(0)}s.currentSave=s.getCurrentTime();s.currentTime=s.currentSave;s.playing=false},close:function(){var s=this; if(!s.playing){return}if(s.timeout){clearTimeout(s.timeout);delete s.timeout}if(s.bufferSource.stop){s.bufferSource.stop(0)}else{s.bufferSource.noteOff(0)}s.playing=false;s.currentTime=0;s.currentSave=0},ll_check:function(){var s=this;if(!s.playing){return}if(s.currentTimeTos.length?s.length:to}else{s.currentTimeTo=s.length}if(s.timeout){clearTimeout(s.timeout);delete s.timeout}s.timeout=setTimeout(function(){s._onended()},(s.currentTimeTo-s.data.currentTime)*1000);s.data.loop=false;s.loopIndex=0;s.playing=true;s.data.play()},playSegment:function(c,seg,l){this.playTo(c,c+seg,l)},playTo:function(c,to,l){this.play(c,l,to)},stop:function(){var s=this;if(!s.playing){return}if(s.timeout){clearTimeout(s.timeout);delete s.timeout}s.playing=false;s.data.pause()},close:function(){var s=this;if(!s.playing){return}if(s.timeout){clearTimeout(s.timeout);delete s.timeout}s.playing=false;s.data.pause();s.data.currentTime=0;s.currentSave=0},ll_check:function(){var s=this;if(!s.playing){return}if(s.data.duration!=s._ll_duration){s._ll_duration=s.data.duration;s.length=s.data.duration-(LGlobal.android?0.1:0)}if(s.currentTimeTo=0;i--){if(l[i]){l[i].ll_check()}}},add:function(obj){if(LSound.Container.list.indexOf(obj)>=0){return}LSound.Container.list.push(obj)},remove:function(obj){var l=LSound.Container.list;for(var i=l.length-1;i>=0;i--){if(l[i].objectIndex==obj.objectIndex){l.splice(i,1);break}}},stopOther:function(obj){var l=LSound.Container.list;for(var i=l.length-1;i>=0;i--){if(l[i].objectIndex!=obj.objectIndex){l[i].stop()}}}};LGlobal.childList.push(LSound.Container);return LSound})();var LVideo=(function(){function LVideo(u){var s=this;LExtends(s,LMedia,[]);s.type="LVideo";s._type="video";s.rotatex=0;s.rotatey=0;s.data=document.createElement("video");s.data.style.display="none";document.body.appendChild(s.data);s.data.id="video_"+s.objectIndex;s.data.loop=false;s.data.autoplay=false; if(u){s.load(u)}}var p={_ll_show:function(c){var s=this;c.drawImage(s.data,s.x,s.y)},die:function(){var s=this;document.body.removeChild(s.data);delete s.data},getWidth:function(){return this.data.width},getHeight:function(){return this.data.height}};for(var k in p){LVideo.prototype[k]=p[k]}return LVideo})();var LPoint=(function(){function LPoint(x,y){var s=this;s.x=x;s.y=y}LPoint.distance=function(p1,p2){return LPoint.distance2(p1.x,p1.y,p2.x,p2.y)};LPoint.distance2=function(x1,y1,x2,y2){var x=x1-x2,y=y1-y2;return Math.sqrt(x*x+y*y)};LPoint.interpolate=function(p1,p2,f){return new LPoint(p1.x+(p2.x-p1.x)*(1-f),p1.y+(p2.y-p1.y)*(1-f))};LPoint.polar=function(l,a){return new LPoint(l*Math.cos(a),l*Math.sin(a))};LPoint.prototype={toString:function(){return"[object LPoint("+this.x+","+this.y+")]"},length:function(){return LPoint.distance2(this.x,this.y,0,0)},add:function(v){return LPoint(this.x+v.x,this.y+v.y)},clone:function(){return new LPoint(this.x,this.y)},setTo:function(x,y){this.x=x,this.y=y},copyFrom:function(s){this.setTo(s.x,s.y)},equals:function(t){return this.x==t.x&&this.y==t.y},normalize:function(t){var s=this,scale=t/s.length();s.x*=scale,s.y*=scale},offset:function(dx,dy){this.x+=dx;this.y+=dy},subtract:function(v){return new LPoint(this.x-v.x,this.y-v.y)}};return LPoint})();var LRectangle=(function(){function LRectangle(x,y,w,h){var s=this;s.x=x;s.y=y;s.width=w;s.height=h;s.setRectangle()}LRectangle.prototype={setRectangle:function(){var s=this;s.bottom=s.y+s.height;s.right=s.x+s.width;s.left=s.x;s.top=s.y},clone:function(){var s=this;return new LRectangle(s.x,s.y,s.width,s.height)},contains:function(x,y){var s=this;return x>=s.x&&x<=s.right&&y>=s.y&&y<=s.bottom},containsRect:function(rect){var s=this;return rect.x>=s.x&&rect.right<=s.right&&rect.y>=s.y&&rect.bottom<=s.bottom},equals:function(v){var s=this;return v.x==s.x&&v.width==s.width&&v.y==s.y&&v.height==s.height},inflate:function(dx,dy){var s=this;s.width+=dx;s.height+=dy;s.setRectangle()},intersection:function(t){var s=this;var ix=s.x>t.x?s.x:t.x;var iy=s.y>t.y?s.y:t.y;var ax=s.right>t.right?t.right:s.right;var ay=s.bottom>t.bottom?t.bottom:s.bottom;if(ix<=ax&&iy<=ay){return new LRectangle(ix,iy,ax,ay)}else{return new LRectangle(0,0,0,0)}},intersects:function(t){var s=this;var ix=s.x>t.x?s.x:t.x;var iy=s.y>t.y?s.y:t.y;var ax=s.right>t.right?t.right:s.right;var ay=s.bottom>t.bottom?t.bottom:s.bottom;return ix<=ax&&iy<=ay},isEmpty:function(){var s=this;return s.x==0&&s.y==0&&s.width==0&&s.height==0},offset:function(dx,dy){var s=this;s.x+=dx;s.y+=dy;s.setRectangle()},setEmpty:function(){var s=this;s.x=0;s.y=0;s.width=0;s.height=0;s.setRectangle()},setTo:function(xa,ya,w,h){var s=this;s.x=xa;s.y=ya;s.width=w;s.height=h;s.setRectangle()},toString:function(){var s=this;return"[object LRectangle("+s.x+","+s.y+","+s.width+","+s.height+")]"},union:function(t){var s=this;return new LRectangle(s.x>t.x?t.x:s.x,s.y>t.y?t.y:s.y,s.right>t.right?s.right:t.right,s.bottom>t.bottom?s.bottom:t.bottom)}};return LRectangle})();var LGraphics=(function(){function LGraphics(){var s=this;LExtends(s,LObject,[]);s.type="LGraphics";s.color="#000000";s.alpha=1;s.bitmap=null;s.setList=new Array();s.showList=new Array()}var p={ll_show:function(){var s=this,k,l=s.setList.length;if(l==0){return}for(k=0;k0){c.lineWidth=tn;c.strokeStyle=lco;c.stroke()}});s.showList.push({type:LShape.RECT,arg:pa})},drawArc:function(tn,lco,pa,isf,co){var s=this;s.setList.push(function(){var c=LGlobal.canvas;c.beginPath();if(pa.length>6&&pa[6]){c.moveTo(pa[0],pa[1])}c.arc(pa[0],pa[1],pa[2],pa[3],pa[4],pa[5]);if(pa.length>6&&pa[6]){c.lineTo(pa[0],pa[1])}if(s.bitmap){c.save();c.clip();c.drawImage(s.bitmap.image,s.bitmap.x,s.bitmap.y,s.bitmap.width,s.bitmap.height,0,0,s.bitmap.width,s.bitmap.height);c.restore();s.bitmap=null;return}if(isf){c.fillStyle=co;c.fill()}if(tn>0){c.lineWidth=tn;c.strokeStyle=lco;c.stroke()}});s.showList.push({type:LShape.ARC,arg:pa})},drawRect:function(tn,lco,pa,isf,co){var s=this;s.setList.push(function(){var c=LGlobal.canvas;c.beginPath();c.rect(pa[0],pa[1],pa[2],pa[3]);c.closePath();if(s.bitmap){c.save();c.clip();c.drawImage(s.bitmap.image,s.bitmap.x,s.bitmap.y,s.bitmap.width,s.bitmap.height,0,0,s.bitmap.width,s.bitmap.height);c.restore();s.bitmap=null;return}if(isf){c.fillStyle=co;c.fill()}if(tn>0){c.lineWidth=tn;c.strokeStyle=lco;c.stroke()}});s.showList.push({type:LShape.RECT,arg:pa})},drawRoundRect:function(tn,lco,pa,isf,co){var s=this;s.setList.push(function(){var c=LGlobal.canvas;c.beginPath();c.moveTo(pa[0]+pa[4],pa[1]);c.lineTo(pa[0]+pa[2]-pa[4],pa[1]);c.arcTo(pa[0]+pa[2],pa[1],pa[0]+pa[2],pa[1]+pa[4],pa[4]);c.lineTo(pa[0]+pa[2],pa[1]+pa[3]-pa[4]);c.arcTo(pa[0]+pa[2],pa[1]+pa[3],pa[0]+pa[2]-pa[4],pa[1]+pa[3],pa[4]);c.lineTo(pa[0]+pa[4],pa[1]+pa[3]);c.arcTo(pa[0],pa[1]+pa[3],pa[0],pa[1]+pa[3]-pa[4],pa[4]);c.lineTo(pa[0],pa[1]+pa[4]);c.arcTo(pa[0],pa[1],pa[0]+pa[4],pa[1],pa[4]);c.closePath();if(s.bitmap){c.save();c.clip();c.drawImage(s.bitmap.image,0,0,s.bitmap.width,s.bitmap.height,0,0,s.bitmap.width,s.bitmap.height);c.restore();s.bitmap=null;return}if(isf){c.fillStyle=co;c.fill()}if(tn>0){c.lineWidth=tn;c.strokeStyle=lco;c.stroke()}});s.showList.push({type:LShape.RECT,arg:pa})},drawVertices:function(tn,lco,v,isf,co){var s=this;if(v.length<3){return}s.setList.push(function(){var c=LGlobal.canvas;c.beginPath();c.moveTo(v[0][0],v[0][1]);var i,l=v.length,pa;for(i=1;i0){c.lineWidth=tn;c.strokeStyle=lco;c.closePath();c.stroke()}});s.showList.push({type:LShape.VERTICES,arg:v})},drawTriangles:function(ve,ind,u,tn,lco){var s=this;var i,j,l=ind.length,c;s.setList.push(function(){c=LGlobal.canvas;var v=ve,a,k,sw;for(i=0,j=0;i=l){w=(u[ind[i+j-l]*2]-u[ind[i+1]*2])*s.bitmap.width;sw=u[ind[i]*2]==1?0:s.bitmap.width*u[ind[i]*2]+w;if(sw>s.bitmap.width){sw-=s.bitmap.width}}else{sw=s.bitmap.width*u[ind[i+j]*2]}sh=s.bitmap.height*u[ind[i]*2+1];if(h<0){h=(u[ind[i+2-(i>0?6:-6)]*2+1]-u[ind[i-(i>0?6:-6)]*2+1])*s.bitmap.height;sh=0}var t1=(v[ind[i+1]*2]-v[ind[i]*2])/w;var t2=(v[ind[i+1]*2+1]-v[ind[i]*2+1])/w;var t3=(v[ind[i+2]*2]-v[ind[i]*2])/h;var t4=(v[ind[i+2]*2+1]-v[ind[i]*2+1])/h;c.transform(t1,t2,t3,t4,v[ind[i]*2],v[ind[i]*2+1]);c.drawImage(s.bitmap.image,s.bitmap.x+sw,s.bitmap.y+sh,w,h,0,0,w,h)}else{var w=(u[ind[i+2+j]*2]-u[ind[i+1+j]*2])*s.bitmap.width;var h=(u[ind[i+2]*2+1]-u[ind[i]*2+1])*s.bitmap.height;if(j==0&&w<0){for(k=i+9;k=l){w=(u[ind[i+1+j-l]*2]-u[ind[i+2]*2])*s.bitmap.width; sw=u[ind[i+1]*2]==1?0:s.bitmap.width*u[ind[i+1]*2]+w;if(sw>s.bitmap.width){sw-=s.bitmap.width}}else{sw=s.bitmap.width*u[ind[i+1+j]*2]}sh=s.bitmap.height*u[ind[i]*2+1];if(h<0){h=(u[ind[i+2-(i>0?6:-6)]*2+1]-u[ind[i-(i>0?6:-6)]*2+1])*s.bitmap.height;sh=0}var t1=(v[ind[i+2]*2]-v[ind[i+1]*2])/w;var t2=(v[ind[i+2]*2+1]-v[ind[i+1]*2+1])/w;var t3=(v[ind[i+2]*2]-v[ind[i]*2])/h;var t4=(v[ind[i+2]*2+1]-v[ind[i]*2+1])/h;c.transform(t1,t2,t3,t4,v[ind[i+1]*2],v[ind[i+1]*2+1]);c.drawImage(s.bitmap.image,s.bitmap.x+sw,s.bitmap.y+sh,w,h,0,-h,w,h)}c.restore()}})},drawLine:function(tn,lco,pa){var s=this;s.setList.push(function(){var c=LGlobal.canvas;c.beginPath();c.moveTo(pa[0],pa[1]);c.lineTo(pa[2],pa[3]);c.lineWidth=tn;c.strokeStyle=lco;c.closePath();c.stroke()});s.showList.push({type:LShape.LINE,arg:pa})},add:function(f){this.setList.push(f)},ismouseon:function(e,co){var s=this;if(e==null||e==UNDEFINED||s.showList.length==0||!s.parent){return false}return s.parent.ismouseonShapes(s.showList,e.offsetX,e.offsetY)},getWidth:function(){var s=this,k,k1,min,max,v,l,l1;for(k=0,l=s.showList.length;ks.showList[k].arg[0]||typeof min==UNDEFINED){min=s.showList[k].arg[0]}if(maxs.showList[k].arg[0]-s.showList[k].arg[2]||typeof min==UNDEFINED){min=s.showList[k].arg[0]-s.showList[k].arg[2]}if(maxv[0]||typeof min==UNDEFINED){min=v[0]}if(maxs.showList[k].arg[0]||typeof min==UNDEFINED){min=s.showList[k].arg[0]}if(min>s.showList[k].arg[2]||typeof min==UNDEFINED){min=s.showList[k].arg[2]}if(maxs.showList[k].arg[0]||typeof min==UNDEFINED){min=s.showList[k].arg[0]}if(max0&&max==min){max=min+1}return max-min},getHeight:function(){var s=this,k=null,k1=null,l,l1,min,max,v;for(k=0,l=s.showList.length;ks.showList[k].arg[1]||typeof min==UNDEFINED){min=s.showList[k].arg[1]}if(maxs.showList[k].arg[1]-s.showList[k].arg[2]||typeof min==UNDEFINED){min=s.showList[k].arg[1]-s.showList[k].arg[2]}if(maxv[1]||typeof min==UNDEFINED){min=v[1]}if(maxs.showList[k].arg[1]||typeof min==UNDEFINED){min=s.showList[k].arg[1]}if(min>s.showList[k].arg[3]||typeof min==UNDEFINED){min=s.showList[k].arg[3]}if(maxs.showList[k].arg[1]||typeof min==UNDEFINED){min=s.showList[k].arg[1]}if(max0&&max==min){max=min+1}return max-min},startX:function(){var s=this;s.getWidth();return s.left},startY:function(){var s=this;s.getHeight();return s.top}};for(var k in p){LGraphics.prototype[k]=p[k]}return LGraphics})();var LShape=(function(){function LShape(){var s=this;LExtends(s,LInteractiveObject,[]);s.type="LShape";s.graphics=new LGraphics();s.graphics.parent=s}LShape.POINT="point";LShape.LINE="line";LShape.ARC="arc";LShape.RECT="rect";LShape.VERTICES="vertices";var p={_ll_show:function(c){var s=this;s.graphics.ll_show()},getWidth:function(maskSize){var s=this,mx,mw,left=s.graphics.startX(),right=left+s.graphics.getWidth();if(maskSize&&s.mask){mx=s.mask._startX?s.mask._startX():s.mask.startX();mw=s.mask.getWidth();if(leftmx+mw){right=mx+mw}}s.ll_left=s.x+left;s.ll_right=s.x+right;return(right-left)*s.scaleX},getHeight:function(maskSize){var s=this,my,mh,top=s.graphics.startY(),bottom=top+s.graphics.getHeight();if(maskSize&&s.mask){my=s.mask._startY?s.mask._startY():s.mask.startY();mh=s.mask.getHeight();if(topmy+mh){bottom=my+mh}}s.ll_top=s.y+top;s.ll_bottom=s.y+bottom; return(bottom-top)*s.scaleY},_startX:function(){var s=this;s.getWidth();return s.ll_left},startX:function(){var s=this;return s._startX()*s.scaleX},_startY:function(){var s=this;s.getHeight();return s.ll_top},startY:function(){var s=this;return s._startY()*s.scaleY},clone:function(){var s=this,a=new LShape(),c,o;a.copyProperty(s);a.graphics=s.graphics.clone();a.graphics.parent=a;return a},ismouseon:function(e,cd){var s=this,i=false,sc;if(!s.visible||e==null){return false}if(s.mask){if(!s.mask.parent){s.mask.parent=s.parent}if(!s.mask.ismouseon(e,cd)){return false}}sc={x:s.x*cd.scaleX+cd.x,y:s.y*cd.scaleY+cd.y,scaleX:cd.scaleX*s.scaleX,scaleY:cd.scaleY*s.scaleY};if(s.graphics){i=s.graphics.ismouseon(e,sc)}return i},die:function(){var s=this;s.graphics.clear()}};for(var k in p){LShape.prototype[k]=p[k]}return LShape})();var LSprite=(function(){function LSprite(){var s=this;LExtends(s,LDisplayObjectContainer,[]);s.type="LSprite";s.rotatex;s.rotatey;s.graphics=new LGraphics();s.graphics.parent=s;s.box2dBody=null;s.shapes=new Array();s.dragRange=null}var p={setRotate:function(angle){var s=this;if(s.box2dBody){s.box2dBody.SetAngle(angle)}else{s.rotate=angle}},_rotateReady:function(){var s=this;if(s.box2dBody){if((typeof s.rotatex)==UNDEFINED){s.getRotateXY()}s.x=s.box2dBody.GetPosition().x*LGlobal.box2d.drawScale-s.parent.x-s.rotatex;s.y=s.box2dBody.GetPosition().y*LGlobal.box2d.drawScale-s.parent.y-s.rotatey;s.rotate=s.box2dBody.GetAngle()}},_ll_show:function(c){var s=this;s.graphics.ll_show();LGlobal.show(s.childList);s._ll_debugShape()},startDrag:function(touchPointID){var s=this,r,c;if(s.ll_dragStart){return}s.ll_touchPointID=touchPointID;s.ll_dragStartX=s.x;s.ll_dragStartY=s.y;s.ll_dragMX=mouseX;s.ll_dragMY=mouseY;s.ll_dragStart=true;LGlobal.dragList.push(s)},stopDrag:function(){var s=this,i,l;for(i=0,l=LGlobal.dragList.length;iright){right=b}}if(maskSize&&s.mask){mx=s.mask._startX?s.mask._startX():s.mask.startX();mw=s.mask.getWidth();if(leftmx+mw){right=mx+mw}}s.ll_left=s.x+left;s.ll_right=s.x+right;return(right-left)*s.scaleX},getHeight:function(maskSize){var s=this,i,l,o,a,b,my,mh,top=s.graphics.startY(),bottom=top+s.graphics.getHeight();for(i=0,l=s.childList.length;ibottom){bottom=b}}if(maskSize&&s.mask){my=s.mask._startY?s.mask._startY():s.mask.startY();mh=s.mask.getHeight();if(topmy+mh){bottom=my+mh}}s.ll_top=s.y+top;s.ll_bottom=s.y+bottom;return(bottom-top)*s.scaleY},_startX:function(){var s=this;s.getWidth();return s.ll_left},startX:function(){var s=this;return s._startX()*s.scaleX},_startY:function(){var s=this;s.getHeight();return s.ll_top},startY:function(){var s=this;return s._startY()*s.scaleY},_ll_loopframe:function(){this.dispatchEvent(LEvent.ENTER_FRAME)},clone:function(){var s=this,a=new LSprite(),c,o,i,l;a.copyProperty(s);a.graphics=s.graphics.clone();a.graphics.parent=a;a.childList.length=0;for(i=0,l=s.childList.length;i=0;k--){if(s.childList[k].mouseEvent&&s.childList[k].ll_mouseout){s.childList[k].ll_mouseout(e,type,cd,ox,oy)}}}}},mouseEvent:function(e,type,cd){if(!e){return false}var s=this,i,k,ox=e.offsetX,oy=e.offsetY,on,mc;if(!s.visible){return false}if(cd==null){cd={x:0,y:0,scaleX:1,scaleY:1}}on=s.ismouseon(e,cd);if(on){if(type==LMouseEvent.MOUSE_MOVE&&!s.ll_mousein){s.ll_mousein=true;if(s._mevent(LMouseEvent.MOUSE_OVER)){s.ll_dispatchMouseEvent(LMouseEvent.MOUSE_OVER,e,cd,ox,oy)}}if(s.mouseChildren){mc={x:s.x*cd.scaleX+cd.x,y:s.y*cd.scaleY+cd.y,scaleX:cd.scaleX*s.scaleX,scaleY:cd.scaleY*s.scaleY}; for(k=s.childList.length-1;k>=0;k--){if(s.childList[k].mouseEvent){i=s.childList[k].mouseEvent(e,type,mc);if(i){e.target=s.childList[k];if(type!=LMouseEvent.MOUSE_MOVE){break}}}}if(s._mevent(type)){s.ll_dispatchMouseEvent(type,e,cd,ox,oy)}}return true}else{s.ll_mouseout(e,type,cd,ox,oy)}return false},hitTestPoint:function(x,y){var s=this,shapes=s.shapes;if(!shapes||shapes.length==0){s.getWidth();s.getHeight();shapes=[{"type":LShape.RECT,"arg":[s.ll_left-s.x,s.ll_top-s.y,s.ll_right-s.ll_left,s.ll_bottom-s.ll_top]}]}return s.ismouseonShapes(shapes,x,y)},hitTestObject:function(obj){var s=this,shapes=s.shapes,shapes1=obj.shapes,m,m1,j,child,j1,child1,vo1,v1;if(!shapes||shapes.length==0){s.getWidth();s.getHeight();shapes=[{"type":LShape.RECT,"arg":[s.ll_left-s.x,s.ll_top-s.y,s.ll_right-s.ll_left,s.ll_bottom-s.ll_top]}]}if(!shapes1||shapes1.length==0){obj.getWidth();obj.getHeight();shapes1=[{"type":LShape.RECT,"arg":[obj.ll_left-obj.x,obj.ll_top-obj.y,obj.ll_right-obj.ll_left,obj.ll_bottom-obj.ll_top]}]}m=s.getRootMatrix();m1=obj.getRootMatrix();for(j=shapes.length-1;j>=0;j--){child=shapes[j];v1=s._changeShape(child.type,child.arg,m);for(j1=shapes1.length-1;j1>=0;j1--){child1=shapes1[j1];vo1=obj._changeShape(child1.type,child1.arg,m1);if(child.type==LShape.VERTICES||child.type==LShape.RECT){if(child1.type==LShape.VERTICES||child1.type==LShape.RECT){if(LGlobal.hitTestPolygon(v1,vo1)){return true}}else{if(child1.type==LShape.ARC){if(LGlobal.hitTestPolygonArc(v1,vo1)){return true}}}}else{if(child1.type==LShape.VERTICES||child1.type==LShape.RECT){if(LGlobal.hitTestPolygonArc(vo1,v1)){return true}}else{if(child1.type==LShape.ARC){if(Math.sqrt((v1[0]-vo1[0])*(v1[0]-vo1[0])+(v1[1]-vo1[1])*(v1[1]-vo1[1]))0){return s.ismouseonShapes(s.shapes,e.offsetX,e.offsetY)}var k,i=false,l=s.childList,sc={x:s.x*cd.scaleX+cd.x,y:s.y*cd.scaleY+cd.y,scaleX:cd.scaleX*s.scaleX,scaleY:cd.scaleY*s.scaleY};for(k=l.length-1;k>=0;k--){if(l[k].ismouseon){i=l[k].ismouseon(e,sc)}if(i){e.target=s.childList[k];break}}if(!i){i=s.graphics.ismouseon(e,sc)}return i},die:function(){var s=this,i,c,l;s.graphics.clear();s.removeAllEventListener();s.stopDrag();if(s.box2dBody){s.clearBody()}for(i=0,c=s.childList,l=c.length;i4){break}pattern=/(([^\s]*?)(\s*)=(\s*)("|')(.*?)\5)*/g;var arr=pattern.exec(attribute);if(!arr||!arr[0]){break}switch(arr[2]){case"face":tf.font=arr[6];break;case"color":tf.color=arr[6];break;case"size":tf.size=arr[6];break}attribute=attribute.replace(arr[0],"").replace(/(^\s*)|(\s*$)|(\n)/g,"")}}else{if(tabName=="b"){tf.bold=true}else{if(tabName=="u"){tf.underline=true}else{if(tabName=="i"){tf.italic=true}else{if(tabName=="p"&&s.wordWrap){text="\n"+text+"\n"}else{if(s.styleSheet){var sheetObj;if(tabName=="span"){pattern=/(([^\s]*?)(\s*)=(\s*)("|')(.*?)\5)*/g;var arr=pattern.exec(attribute);if(arr&&arr[0]){switch(arr[2]){case"class":sheetObj=s.styleSheet.getStyle("."+arr[6]);break}}}else{if(s.styleSheet.getStyle(tabName)){sheetObj=s.styleSheet.getStyle(tabName)}}if(sheetObj){tf.setCss(sheetObj)}}}}}}}s.ll_getHtmlText(tf,text)},ll_getHtmlText:function(tf,text){if(!text){return}var s=this,tabName,content,start,end,pattern=/<(.*?)(\s*)(.*?)>(.*?)<\/\1>/g,arr=pattern.exec(text);if(!arr||!arr[0]){s.ll_htmlTexts.push({textFormat:tf.clone(),text:text});return}if(arr.index>0){s.ll_htmlTexts.push({textFormat:tf.clone(),text:text.substring(0,arr.index)})}tabName=arr[1];start=arr.index;end=start;do{end=text.indexOf("0&&start",arr.index)+1,end);s.ll_getStyleSheet(tf,tabName,arr[3],content);s.ll_getHtmlText(tf,text.substring(end+tabName.length+3))},_ll_show:function(c){var s=this,d,lbl,i,rc,j,l,k,m,b,h,enter,tf,underlineY;if(s.texttype==LTextFieldType.INPUT){s.inputBackLayer.ll_show();rc=s.getRootCoordinate();if(LGlobal.inputBox.name=="input"+s.objectIndex){LGlobal.inputBox.style.marginTop=(parseInt(LGlobal.canvasObj.style.marginTop)+(((rc.y+s.inputBackLayer.startY())*parseInt(LGlobal.canvasObj.style.height)/LGlobal.canvasObj.height)>>>0))+"px";LGlobal.inputBox.style.marginLeft=(parseInt(LGlobal.canvasObj.style.marginLeft)+(((rc.x+s.inputBackLayer.startX())*parseInt(LGlobal.canvasObj.style.width)/LGlobal.canvasObj.width)>>>0))+"px"}if(LGlobal.inputTextField&&LGlobal.inputTextField.objectIndex==s.objectIndex){return}}if(LGlobal.fpsStatus){LGlobal.fpsStatus.text++}c.fillStyle=s.color;if(s.stroke){c.strokeStyle=s.lineColor;c.lineWidth=s.lineWidth+1}if(s.htmlText){if(s.ll_htmlText!=s.htmlText||(s.styleSheet&&(s.ll_style_objectIndex!=s.styleSheet.objectIndex||s.ll_styleIndex==s.styleSheet.styleIndex))){tf=new LTextFormat();s.ll_htmlTexts=[];s.ll_htmlText=s.htmlText;if(s.styleSheet){s.ll_style_objectIndex=s.styleSheet.objectIndex;s.ll_styleIndex=s.styleSheet.styleIndex}s.ll_getHtmlText(tf,s.htmlText)}j=0,k=0,m=0,b=0;s._wordHeight=s.wordHeight||30;if(!LTextField.underlineY){LTextField.underlineY={"alphabetic":0,"top":1,"bottom":-0.2,"middle":0.4,"hanging":0.8}}s.ll_htmlTexts.forEach(function(element){var textFormat=element.textFormat,text=element.text;c.font=textFormat.getFontText();c.fillStyle=textFormat.color;for(i=0,l=text.length;is.width){j=0;k=i+1;m++}}s.height=(m+1)*s._wordHeight});return}lbl=s.text;if(s.displayAsPassword){lbl="";for(i=0,l=s.text.length;is.width){j=0;k=i+1;m++}}s.height=(m+1)*s.wordHeight}else{s.numLines=1;if(s.stroke){c.strokeText(lbl,0,0,c.measureText(lbl).width)}c.fillText(lbl,0,0,c.measureText(lbl).width)}if(s.windRunning){s._ll_windRun()}},_wordHeight:function(h){var s=this;if(h>0){s.wordHeight=h}else{s.wordWrap=false;s.wordHeight=s.getHeight()}s.height=0},setMultiline:function(v,h){var s=this;if(v){s._wordHeight(h)}s.multiline=v},setWordWrap:function(v,h){var s=this;if(v){s._wordHeight(h)}s.wordWrap=v},setType:function(type,inputBackLayer){var s=this;if(s.texttype!=type&&type==LTextFieldType.INPUT){if(inputBackLayer==null||inputBackLayer.type!="LSprite"){s.inputBackLayer=new LSprite(); s.inputBackLayer.graphics.drawRect(1,"#000000",[0,-s.getHeight()*0.4,s.width,s.getHeight()*1.5])}else{s.inputBackLayer=inputBackLayer}s.inputBackLayer.parent=s;if(LMouseEventContainer.container[LMouseEvent.MOUSE_DOWN]){LMouseEventContainer.pushInputBox(s)}}else{s.inputBackLayer=null;LMouseEventContainer.removeInputBox(s)}s.texttype=type},ismouseon:function(e,cood){var s=this;if(!e){return false}if(!s.visible){return false}if(!cood){cood={x:0,y:0,scaleX:1,scaleY:1}}if(s.mask){if(!s.mask.parent){s.mask.parent=s.parent}if(!s.mask.ismouseon(e,cood)){return false}}if(s.inputBackLayer){return s.inputBackLayer.ismouseon(e,{x:s.x*cood.scaleX+cood.x,y:s.y*cood.scaleY+cood.y,scaleX:cood.scaleX*s.scaleX,scaleY:cood.scaleY*s.scaleY})}return s.ismouseonShapes([{type:LShape.RECT,arg:[0,0,s._getWidth(),s._getHeight()]}],e.offsetX,e.offsetY)},clone:function(){var s=this,a=new s.constructor();a.copyProperty(s);a.texttype=null;if(s.texttype==LTextFieldType.INPUT){a.setType(LTextFieldType.INPUT)}return a},mouseEvent:function(event,type,cood){var s=this,on;if(s.inputBackLayer==null||type!=LMouseEvent.MOUSE_DOWN){return}on=s.ismouseon(event,cood);if(!on){return}s.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 s=this;if(s.texttype==LTextFieldType.INPUT&&LGlobal.inputTextField.objectIndex==s.objectIndex){LGlobal.inputTextBox.value=LGlobal.inputTextField.text}},_ll_input:function(e){var event=new LEvent(LTextEvent.TEXT_INPUT);event.keyCode=e.keyCode;LGlobal.inputTextField.text=LGlobal.inputTextBox.value;if(LGlobal.inputTextField.hasEventListener(LTextEvent.TEXT_INPUT)){e.returnValue=LGlobal.inputTextField.dispatchEvent(event)}else{e.returnValue=true}},focus:function(){var s=this,sc,sx;if(!s.parent){return}if(s.texttype!=LTextFieldType.INPUT){return}if(LGlobal.inputTextField&&LGlobal.inputTextField.objectIndex!=s.objectIndex){s._ll_getValue()}s.dispatchEvent(LFocusEvent.FOCUS_IN);sc=s.getAbsoluteScale();LGlobal.inputBox.style.display="";LGlobal.inputBox.name="input"+s.objectIndex;LGlobal.inputTextField=s;LGlobal.inputTextareaBoxObj.style.display=NONE;LGlobal.inputTextBoxObj.style.display=NONE;LGlobal.passwordBoxObj.style.display=NONE;if(s.displayAsPassword){LGlobal.inputTextBox=LGlobal.passwordBoxObj}else{if(s.multiline){LGlobal.inputTextBox=LGlobal.inputTextareaBoxObj}else{LGlobal.inputTextBox=LGlobal.inputTextBoxObj}}sx=parseInt(LGlobal.canvasObj.style.width)/LGlobal.canvasObj.width;sy=parseInt(LGlobal.canvasObj.style.height)/LGlobal.canvasObj.height;LGlobal.inputTextBox.style.display="";LGlobal.inputTextBox.value=s.text;LGlobal.inputTextBox.style.height=s.inputBackLayer.getHeight()*sc.scaleY*s.scaleY*sy+"px";LGlobal.inputTextBox.style.width=s.inputBackLayer.getWidth()*sc.scaleX*s.scaleX*sx+"px";LGlobal.inputTextBox.style.color=s.color;LGlobal.inputTextBox.style.fontSize=((s.size*parseFloat(LGlobal.canvasObj.style.height)/LGlobal.canvasObj.height)>>0)+"px";LGlobal.inputTextBox.style.fontFamily=s.font;LEvent.addEventListener(LGlobal.inputTextBox,LKeyboardEvent.KEY_DOWN,LGlobal.inputTextField._ll_input);if(s.texttype==LTextFieldType.INPUT){rc=s.getRootCoordinate();if(LGlobal.inputBox.name=="input"+s.objectIndex){LGlobal.inputBox.style.marginTop=(parseInt(LGlobal.canvasObj.style.marginTop)+(((rc.y+s.inputBackLayer.startY())*parseInt(LGlobal.canvasObj.style.height)/LGlobal.canvasObj.height)>>>0))+"px";LGlobal.inputBox.style.marginLeft=(parseInt(LGlobal.canvasObj.style.marginLeft)+(((rc.x+s.inputBackLayer.startX())*parseInt(LGlobal.canvasObj.style.width)/LGlobal.canvasObj.width)>>>0))+"px"}}setTimeout(function(){LGlobal.inputTextBox.focus()},0)},_getWidth:function(){var s=this;if(s.wordWrap){return s.width}LGlobal.canvas.font=s.size+"pt "+s.font;return LGlobal.canvas.measureText(s.text).width},getWidth:function(maskSize){var s=this,w,mx,mw;w=s._getWidth()*s.scaleX;if(maskSize&&s.mask){mx=s.mask._startX?s.mask._startX():s.mask.startX();if(mx>w){return 0}mw=s.mask.getWidth();if(mx+mw>w){return w-mx}else{return mw}}return w},_getHeight:function(){var s=this,c=LGlobal.canvas,i,l,j,k,m,enter;if(s.wordWrap){c.font=s.weight+" "+s.size+"pt "+s.font;if(s.height==0){j=0,k=0,m=0;for(i=0,l=s.text.length;is.width)||enter){j=0;k=i;m++;if(enter){k++}}}s.height=(m+1)*s.wordHeight}return s.height}c.font=s.weight+" "+s.size+"pt "+s.font;l=c.measureText("O").width*1.2;if(s.heightMode==LTextField.HEIGHT_MODE_BASELINE){l=l*1.2}return l},getHeight:function(maskSize){var s=this,h,my,mh;h=s._getHeight()*s.scaleY;if(maskSize&&s.mask){my=s.mask._startY?s.mask._startY():s.mask.startY();if(my>h){return 0}mh=s.mask.getHeight(); if(my+mh>h){return h-my}else{return mh}}return h},wind:function(listener){var s=this;s.wind_over_function=listener;s.windRunning=true;s._ll_wind_text=s.text;s.text="";s._ll_wind_length=0},_ll_windRun:function(){var s=this;if(s._speedIndex++s._ll_wind_text.length){s.windRunning=false;if(s.wind_over_function){s.wind_over_function()}s.dispatchEvent(new LEvent(LTextEvent.WIND_COMPLETE));return}s.text=s._ll_wind_text.substring(0,s._ll_wind_length);s._ll_wind_length++},die:function(){LMouseEventContainer.removeInputBox(this)}};for(var k in p){LTextField.prototype[k]=p[k]}return LTextField})();var LBitmap=(function(){function LBitmap(bitmapdata){var s=this;LExtends(s,LDisplayObject,[]);s.type="LBitmap";s.rotateCenter=true;s.bitmapData=bitmapdata;if(s.bitmapData){s.width=s.bitmapData.width;s.height=s.bitmapData.height}}var p={_canShow:function(){return(this.visible&&this.bitmapData)},_rotateReady:function(){var s=this;if(s.rotate!=0&&s.rotateCenter){s.rotatex=s.getWidth()*0.5;s.rotatey=s.getHeight()*0.5}else{s.rotatex=s.rotatey=0}},_coordinate:function(c){},_ll_show:function(){this.ll_draw()},ll_draw:function(){var s=this;if(LGlobal.fpsStatus){LGlobal.fpsStatus.bitmapData++}LGlobal.canvas.drawImage(s.bitmapData.image,s.bitmapData.x,s.bitmapData.y,s.bitmapData.width,s.bitmapData.height,s.x,s.y,s.bitmapData.width,s.bitmapData.height)},clone:function(){var s=this,a=new LBitmap(s.bitmapData.clone());a.copyProperty(s);a.rotateCenter=s.rotateCenter;return a},ismouseon:function(e,cood){var s=this;if(!e){return false}if(!s.visible||!s.bitmapData){return false}if(s.mask){if(!s.mask.parent){s.mask.parent=s.parent}if(!s.mask.ismouseon(e,cood)){return false}}return s.ismouseonShapes([{type:LShape.RECT,arg:[0,0,s.bitmapData.width,s.bitmapData.height]}],e.offsetX,e.offsetY)},getWidth:function(maskSize){var s=this,w,mx,mw;w=s.bitmapData!=null?s.bitmapData.width*(s.scaleX>0?s.scaleX:-s.scaleX):0;if(maskSize&&s.mask){mx=s.mask._startX?s.mask._startX():s.mask.startX();if(mx>w){return 0}mw=s.mask.getWidth();if(mx+mw>w){return w-mx}else{return mw}}return w},getHeight:function(maskSize){var s=this,h,my,mh;h=s.bitmapData!=null?s.bitmapData.height*(s.scaleY>0?s.scaleY:-s.scaleY):0;if(maskSize&&s.mask){my=s.mask._startY?s.mask._startY():s.mask.startY();if(my>h){return 0}mh=s.mask.getHeight();if(my+mh>h){return h-my}else{return mh}}return h},startX:function(){return this.x},startY:function(){return this.y},die:function(){}};for(var k in p){LBitmap.prototype[k]=p[k]}return LBitmap})();var LBitmapData=(function(){function LBitmapData(image,x,y,width,height,dataType){var s=this;LExtends(s,LObject,[]);s.type="LBitmapData";if(typeof dataType==UNDEFINED){dataType=LBitmapData.DATA_IMAGE}s.oncomplete=null;s._locked=false;s._setPixel=false;s.x=(x==null?0:x);s.y=(y==null?0:y);s.width=0;s.height=0;s.dataType=null;if(image&&typeof image=="object"){s.image=image;s.dataType=LBitmapData.DATA_IMAGE;s.width=(width==null?s.image.width:width);s.height=(height==null?s.image.height:height);s._setDataType(dataType)}else{s._createCanvas();s.dataType=LBitmapData.DATA_CANVAS;s._canvas.width=s.width=(width==null?1:width);s._canvas.height=s.height=(height==null?1:height);if(typeof image=="string"){image=parseInt(image.replace("#","0x"))}if(typeof image=="number"){var d=s._context.createImageData(s.width,s.height);for(var i=0;i>16&255;d.data[i+1]=image>>8&255;d.data[i+2]=image&255;d.data[i+3]=255}s._context.putImageData(d,0,0)}s.image=s._canvas;if(dataType==LBitmapData.DATA_IMAGE){s._setDataType(dataType)}}s.resize()}LBitmapData.DATA_IMAGE="data_image";LBitmapData.DATA_CANVAS="data_canvas";var p={_setDataType:function(dataType){var s=this;if(s.dataType==dataType){return}if(dataType==LBitmapData.DATA_CANVAS){s._createCanvas();s._canvas.width=s.image.width;s._canvas.height=s.image.height;s._context.clearRect(0,0,s._canvas.width,s._canvas.height);s._context.drawImage(s.image,0,0);s.image=s._canvas}else{if(dataType==LBitmapData.DATA_IMAGE){s.image=new Image();s.image.width=s._canvas.width;s.image.height=s._canvas.height;s.image.src=s._canvas.toDataURL()}}s.dataType=dataType},_createCanvas:function(){var s=this;if(!s._canvas){s._canvas=document.createElement("canvas");s._context=s._canvas.getContext("2d")}},clear:function(){var s=this;s._createCanvas();s._canvas.width=s.image.width;if(s.dataType==LBitmapData.DATA_IMAGE){s.image.src=s._canvas.toDataURL()}},setProperties:function(x,y,width,height){var s=this;s.x=x;s.y=y;s.width=width;s.height=height;s.resize()},setCoordinate:function(x,y){var s=this;s.x=x;s.y=y;s.resize()},clone:function(){var s=this;return new LBitmapData(s.image,s.x,s.y,s.width,s.height,s.dataType)},_ready:function(){var s=this;s._dataType=s.dataType;s._setDataType(LBitmapData.DATA_CANVAS);s._data=s._context.getImageData(s.x,s.y,s.width,s.height)},_update:function(){var s=this;s._context.putImageData(s._data,s.x,s.y,0,0,s.width,s.height);s._setDataType(s._dataType); s._data=null},getPixel:function(x,y,colorType){var s=this,i,d;x=x>>0;y=y>>0;if(!s._locked){s._ready()}i=s.width*4*y+x*4;d=s._data.data;if(!s._locked){s._update()}if(colorType=="number"){return d[i]<<16|d[i+1]<<8|d[i+2]}else{return[d[i],d[i+1],d[i+2],d[i+3]]}},setPixel:function(x,y,data){var s=this;x=x>>0;y=y>>0;if(!s._locked){s._ready()}var d=s._data,i=s.width*4*y+x*4;if(typeof data=="object"){d.data[i+0]=data[0];d.data[i+1]=data[1];d.data[i+2]=data[2];d.data[i+3]=data[3]}else{if(typeof data=="string"){data=parseInt(data.replace("#","0x"))}d.data[i+0]=data>>16&255;d.data[i+1]=data>>8&255;d.data[i+2]=data&255;d.data[i+3]=255}if(!s._locked){s._update()}},getPixels:function(rect){var s=this,r;if(!s._locked){s._ready()}r=s._context.getImageData(s.x+rect.x,s.y+rect.y,rect.width,rect.height);if(!s._locked){s._update()}return r},setPixels:function(rect,data){var s=this,i,j,d,w,sd,x,y;if(!s._locked){s._ready()}d=s._data;if(typeof data=="object"){w=s._canvas.width;for(x=rect.x;x>16&255,data>>8&255,data&255];w=s._canvas.width;for(x=rect.x;x>>0;h=bd.getHeight()>>>0;if(w==0||h==0){s._setDataType(_dataType);return}c=bd.getDataCanvas();if(colorTransform){bd.colorTransform(new LRectangle(0,0,w,h),colorTransform);c=bd.image}if(matrix){s._context.setTransform(matrix.a,matrix.b,matrix.c,matrix.d,matrix.tx,matrix.ty)}if(blendMode){s._context.globalCompositeOperation=blendMode}s._context.drawImage(c,bd.x,bd.y,w,h,0,0,w,h);if(save){s._context.restore()}s._setDataType(_dataType);s.resize()},getDataCanvas:function(){var s=this;var _dataType=s.dataType;s._setDataType(LBitmapData.DATA_CANVAS);s._setDataType(_dataType);return s._canvas},getWidth:function(){return this.width},getHeight:function(){return this.height},resize:function(){var s=this,w=s.image.width-s.x,h=s.image.height-s.y;s.width=s.width>0,y=rect.y>>0,w=rect.width>>0,h=rect.height>>0;var img=s._context.getImageData(s.x+rect.x,s.y+rect.y,rect.width,rect.height);var data=img.data;for(var i=0,l=data.length;i=0&&rowIndex=0&&colIndex=s.imageArray[s.rowIndex].length){s.colIndex=0}arr=s.imageArray[s.rowIndex][s.colIndex];if(s._ll_stepArray[s.rowIndex]&&s._ll_stepArray[s.rowIndex][s.colIndex]){stepFrame=s._ll_stepArray[s.rowIndex][s.colIndex]}else{stepFrame=0}if(s._ll_stepIndex==0){if(typeof arr.dataIndex=="number"&&Array.isArray(s.bitmapList)&&arr.dataIndex=s.imageArray[s.rowIndex].length||s.colIndex<0){s.colIndex=s.mode>0?0:s.imageArray[s.rowIndex].length-1;if(s.constructor.name=="LAnimationTimeline"){s._send_complete=true}else{s.dispatchEvent(LEvent.COMPLETE)}}},clone:function(){var s=this,a=new LAnimation(null,s.bitmap.bitmapData,s.imageArray.slice(0));a.copyProperty(s);a.childList.length=0;a.bitmap=s.bitmap.clone();a.addChild(a.bitmap);return a}};for(var k in p){LAnimation.prototype[k]=p[k]}return LAnimation})();var LAnimationTimeline=(function(){function LAnimationTimeline(data,list){var s=this;LExtends(s,LAnimation,[null,data,list]);s.type="LAnimationTimeline";s.speed=0;s._speedIndex=0;s.ll_labelList={};for(var i=0,sublist,j,child;i=s.list.length){return}s.loadIndex=0;s.loadStart();s.reloadtime=setTimeout(s.loadInit.bind(s),10000)},loadStart:function(){var s=this,d,ph,phs,ext;if(s.loadIndex>=s.list.length){return}d=s.list[s.loadIndex];if(!d.name){d.name=s.llname+s.loadIndex}if(!s.lresult[s.llload+d.name]){if(!d["type"]){ext=getExtension(d.path);if(ext=="txt"){d["type"]=LURLLoader.TYPE_TEXT}else{if(ext=="js"){d["type"]=LURLLoader.TYPE_JS}else{if((new Array("mp3","ogg","wav","m4a")).indexOf(ext)>=0){d["type"]=LSound.TYPE_SOUND}}}}if(d["type"]==LURLLoader.TYPE_TEXT||d["type"]==LURLLoader.TYPE_JS){s.loader=new LURLLoader();s.loader.name=d.name;s.loader.addEventListener(LEvent.COMPLETE,s.loadComplete.bind(s));s.loader.load(s.url(d.path),d["type"])}else{if(d["type"]==LSound.TYPE_SOUND){s.loader=new LSound();s.loader.name=d.name;s.loader.addEventListener(LEvent.COMPLETE,s.loadComplete.bind(s));s.loader.load(d.path)}else{s.loader=new LLoader();s.loader.name=d.name;s.loader.addEventListener(LEvent.COMPLETE,s.loadComplete.bind(s));s.loader.load(s.url(d.path),LLoader.TYPE_BITMAPDATE)}}}s.loadIndex++;s.loadStart()},loadComplete:function(e){var s=this;if(e&&e.currentTarget&&e.currentTarget.name){e.currentTarget.removeEventListener(LEvent.COMPLETE,s.loadComplete);if(e.currentTarget.name.indexOf(s.llname)>=0){e.target=1}if(s.lresult[s.llload+e.currentTarget.name]){return}s.result[e.currentTarget.name]=e.target;s.lresult[s.llload+e.currentTarget.name]=1}s.index++;if(s.onupdate){s.onupdate(Math.floor(s.index*100/s.list.length))}if(s.index>=s.list.length){if(s.reloadtime){clearTimeout(s.reloadtime)}s.loader=null;var r=s.result;LGlobal.forceRefresh=true;s.oncomplete(r)}},url:function(u){if(!LGlobal.traceDebug){return u}return u+(u.indexOf("?")>=0?"&":"?")+"t="+(new Date()).getTime()}};return new LoadManage()})();var LEasing={None:{easeIn:function(t,b,c,d){return b+t*c/d},easeOut:function(t,b,c,d){return b+t*c/d},easeInOut:function(t,b,c,d){return b+t*c/d}},Quad:{easeIn:function(t,b,c,d){return c*(t/=d)*t+b},easeOut:function(t,b,c,d){return -c*(t/=d)*(t-2)+b},easeInOut:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b}return -c/2*((--t)*(t-2)-1)+b}},Cubic:{easeIn:function(t,b,c,d){return c*(t/=d)*t*t+b},easeOut:function(t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOut:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t+b}return c/2*((t-=2)*t*t+2)+b}},Quart:{easeIn:function(t,b,c,d){return c*(t/=d)*t*t*t+b},easeOut:function(t,b,c,d){return -c*((t=t/d-1)*t*t*t-1)+b},easeInOut:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b}return -c/2*((t-=2)*t*t*t-2)+b}},Quint:{easeIn:function(t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOut:function(t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOut:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t*t+b}return c/2*((t-=2)*t*t*t*t+2)+b}},Sine:{easeIn:function(t,b,c,d){return -c*Math.cos(t/d*(Math.PI/2))+c+b},easeOut:function(t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOut:function(t,b,c,d){return -c/2*(Math.cos(Math.PI*t/d)-1)+b}},Strong:{easeIn:function(t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOut:function(t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOut:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t*t+b}return c/2*((t-=2)*t*t*t*t+2)+b}},Expo:{easeIn:function(t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOut:function(t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOut:function(t,b,c,d){if(t==0){return b}if(t==d){return b+c}if((t/=d/2)<1){return c/2*Math.pow(2,10*(t-1))+b}return c/2*(-Math.pow(2,-10*--t)+2)+b}},Circ:{easeIn:function(t,b,c,d){return -c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOut:function(t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOut:function(t,b,c,d){if((t/=d/2)<1){return -c/2*(Math.sqrt(1-t*t)-1)+b}return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b}},Elastic:{easeIn:function(t,b,c,d,a,p){var s;if(t==0){return b}if((t/=d)==1){return b+c}if(!p){p=d*0.3}if(!a||a=s.duration)}else{e=(s.currentTime>=s.duration)}if(e){for(tweentype in s.varsto){s.target[tweentype]=s.varsto[tweentype]}if(s.onComplete){s._dispatchEvent(s.onComplete)}return true}else{if(s.onUpdate){s._dispatchEvent(s.onUpdate)}}return false},_dispatchEvent:function(f){var s=this;s.target.target=s.target;s.target.currentTarget=s;f(s.target);delete s.target.currentTarget;delete s.target.target},to:function($target,$duration,$vars){var s=this;s.toNew.push({target:$target,duration:$duration,vars:$vars});return s},keep:function(){var s=this,t,vs,k;if(s.toNew.length>0){t=s.toNew.shift();if(t.vars.loop){s.loop=true}if(s.loop){vs={};for(k in t.vars){vs[k]=t.vars[k]}s.to(t.target,t.duration,vs)}s.init(t.target,t.duration,t.vars);return true}return false}};for(var k in p){LTweenLiteChild.prototype[k]=p[k]}function LTweenLite(){var s=this;LExtends(s,LObject,[]);s.type="LTweenLite";s.tweens=[]}LTweenLite.TYPE_FRAME="type_frame";LTweenLite.TYPE_TIMER="type_timer";p={count:function(){return this.tweens.length},ll_show:function(){var s=this;var i,length=s.tweens.length,t;for(i=0;i0){url+=((url.indexOf("?")>=0?"&":"?")+data);data=null}ajax.open(t,url,true);if(s.responseType){if(s.responseType==s.JSON){try{ajax.responseType=s.responseType}catch(e){ajax.responseType=s.TEXT;ajax._responseType="json"}}else{ajax.responseType=s.responseType}s.responseType=s.TEXT}ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");ajax.onreadystatechange=function(){if(ajax.readyState==4){if(ajax.status>=200&&ajax.status<300||ajax.status===304){if(oncomplete){if(ajax._responseType==s.JSON){ajax._responseType=s.TEXT;oncomplete(JSON.parse(ajax.responseText))}else{if(ajax.responseType==s.ARRAY_BUFFER||ajax.responseType==s.BLOB||ajax.responseType==s.JSON){oncomplete(ajax.response)}else{if(ajax.responseText.length>0){oncomplete(ajax.responseText)}else{oncomplete(null)}}}}}else{if(err){err(ajax)}}}};ajax.send(data)},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 LAjax()})();var LStageWebView=(function(){function LStageWebView(){var s=this;LExtends(s,LEventDispatcher,[]);s.display=document.createElement("div");s.iframe=document.createElement("iframe");s.display.style.position="absolute";s.display.style.marginTop="0px";s.display.style.marginLeft="0px";s.display.style.zIndex=11;if(LGlobal.ios){s.display.style.overflow="auto";s.display.style.webkitOverflowScrolling="touch"}s.display.appendChild(s.iframe);s.idAdded=false}var p={loadURL:function(u){var s=this;s.iframe.src=u;s.iframe.onload=function(){s.dispatchEvent(LEvent.COMPLETE)}},show:function(){var s=this;if(!s.idAdded){LGlobal.object.appendChild(s.display);s.idAdded=true}if(s.display.style.display=="none"){s.display.style.display=""}},die:function(){LGlobal.object.removeChild(this.display);this.idAdded=false},hide:function(){this.display.style.display="none"},setViewPort:function(r){var s=this,sx=parseInt(LGlobal.canvasObj.style.width)/LGlobal.canvasObj.width,sy=parseInt(LGlobal.canvasObj.style.height)/LGlobal.canvasObj.height;s.display.style.marginTop=(parseInt(LGlobal.canvasObj.style.marginTop)+((r.y*sy)>>>0))+"px";s.display.style.marginLeft=(parseInt(LGlobal.canvasObj.style.marginLeft)+((r.x*sx)>>>0))+"px";s.iframe.style.width=s.display.style.width=(r.width*sx>>>0)+"px";s.iframe.style.height=s.display.style.height=(r.height*sy>>>0)+"px"}};for(var k in p){LStageWebView.prototype[k]=p[k]}return LStageWebView})();var FPS=(function(){function FPS(){var s=this;LExtends(s,LSprite,[]);if(!LGlobal.fpsStatus){LGlobal.fpsStatus={a:0,b:0,c:0,d:0,e:0,bitmapData:0,display:0,transform:0,graphics:0,text:0,reset:function(){this.a=this.bitmapData;this.b=this.display-1;this.c=this.transform-1;this.d=this.graphics-1;this.e=this.text-5;this.bitmapData=0;this.display=0;this.transform=0;this.graphics=0;this.text=0}}}s.fps=[];for(var i=0;i<5;i++){var f=new LTextField();f.color="#ffffff";f.y=i*20;s.addChild(f);s.fps.push(f)}s.fpsCount=0;s.fpsTime=(new Date()).getTime();s.addEventListener(LEvent.ENTER_FRAME,s.showFPS)}FPS.prototype.showFPS=function(e){var s=e.currentTarget,t,f;s.fpsCount++;t=(new Date()).getTime();if(t-s.fpsTime<1000){return}s.fps[0].text="FPS:"+Math.round(s.fpsCount*10000/(t-s.fpsTime))/10;f=LGlobal.fpsStatus;s.fps[1].text="DisplayObject:"+f.c+"/"+f.b;s.fps[2].text="Draw image:"+f.a;s.fps[3].text="Drwa graphics:"+f.d;s.fps[4].text="Draw text:"+f.e;s.fpsTime=t;s.fpsCount=0;s.graphics.clear();s.graphics.drawRect(0,"#000000",[0,0,s.fps[1].getWidth(),100],true,"#000000")};FPS.prototype.die=function(){var s=this;LGlobal.fpsStatus=null;s.callParent("die",arguments)};return FPS})();var LQuadTree=(function(){function LQuadTree(rect){var s=this;LExtends(s,LObject,[]);s.q1=null;s.q2=null;s.q3=null;s.q4=null;s.parent=null;s.data=[];s.rect=rect;s.root=s}var p={createChildren:function(deep){if(deep==0){return}var s=this;var hw=s.rect.width/2,hh=s.rect.height/2;s.q1=new LQuadTree(new LRectangle(s.rect.x+hw,s.rect.y,hw,hh));s.q2=new LQuadTree(new LRectangle(s.rect.x+hw,s.rect.y+hh,hw,hh));s.q3=new LQuadTree(new LRectangle(s.rect.x,s.rect.y+hh,hw,hh));s.q4=new LQuadTree(new LRectangle(s.rect.x,s.rect.y,hw,hh));s.q1.parent=s.q2.parent=s.q3.parent=s.q4.parent=s;s.q1.root=s.q2.root=s.q3.root=s.q4.root=s.root; s.q1.createChildren(deep-1);s.q2.createChildren(deep-1);s.q3.createChildren(deep-1);s.q4.createChildren(deep-1)},hasChildren:function(){var s=this;return s.q1&&s.q2&&s.q3&&s.q4},clear:function(){var s=this;if(s.hasChildren()){return s.q1.clear()||s.q2.clear()||s.q3.clear()||s.q4.clear()}else{s.q1=null;s.q2=null;s.q3=null;s.q4=null;s.parent=null;s.data=[];return s}},add:function(v,x,y){var s=this;if(!s.isIn(x,y)){return null}if(s.hasChildren()){return s.q1.add(v,x,y)||s.q2.add(v,x,y)||s.q3.add(v,x,y)||s.q4.add(v,x,y)}else{s.data.push(v);return s}},remove:function(v,x,y){var s=this;if(!s.isIn(x,y)){return null}if(s.hasChildren()){return s.q1.remove(v,x,y)||s.q2.remove(v,x,y)||s.q3.remove(v,x,y)||s.q4.remove(v,x,y)}else{var index=s.data.indexOf(v);if(index!=-1){s.data.splice(index,1);return s}else{return null}}},isIn:function(x,y){var s=this;return(typeof x==UNDEFINED||(x>=s.rect.x&&x=s.rect.y&&y=100){num_0=s.getNumber(1);num_1=s.getNumber(0);num_2=s.getNumber(0);s_x=s.step*3}else{if(value>=10){num_1=s.getNumber(Math.floor(value/10));num_2=s.getNumber(value%10)}else{num_1=s.getNumber(0);num_2=s.getNumber(value)}}s.back.graphics.clear();s.back.graphics.add(function(){c.beginPath();c.fillStyle=s.backgroundColor;c.fillRect(0,0,LGlobal.width,LGlobal.height);c.closePath();c.fillStyle=s.color;if(value>=100){for(i=0;i=100){for(i=0;i=100){c.shadowOffsetX=0;c.shadowOffsetY=0}};function LoadingSample3(height,background,color){base(this,LSprite,[]);var s=this,c=LGlobal.canvas;s.backgroundColor=background==null?"#000000":background;s.graphics.drawRect(1,s.backgroundColor,[0,0,LGlobal.width,LGlobal.height],true,s.backgroundColor);if(color==null){color=LGlobal._create_loading_color()}s.color=color;s.progress=0;s.screenWidth=LGlobal.width*0.75;s.screenHeight=height==null?LGlobal.height*0.1:height;if(s.screenHeight>5){s.screenHeight=5}s.screenX=(LGlobal.width-s.screenWidth)/2;s.screenY=(LGlobal.height-s.screenHeight)/2;s.back=new LSprite();s.addChild(s.back);s.label=new LTextField();s.label.color="#ffffff";s.label.weight="bolder";s.label.size=s.screenHeight*2;s.label.x=s.screenX+(s.screenWidth-s.label.getWidth())*0.5;s.label.y=s.screenY-s.screenHeight*4;s.addChild(s.label);s.star=new Array();s.addEventListener(LEvent.ENTER_FRAME,s.onframe);s.setProgress(s.progress)}LoadingSample3.prototype.onframe=function(s){var i,star,l;if(s.progress>=100){if(s.star.length>0){for(i=0,l=s.star.length;i100){value=100}s.progress=value;s.back.graphics.clear();s.back.graphics.add(function(){c.beginPath();c.fillStyle="#00FFFF";c.rect(s.screenX-3,s.screenY-3,s.screenWidth+6,s.screenHeight+6);c.fill();c.beginPath();c.fillStyle="#990033";c.rect(s.screenX,s.screenY,s.screenWidth,s.screenHeight);c.fill();c.beginPath();c.fillStyle=s.color;c.rect(s.screenX,s.screenY,s.screenWidth*value*0.01,s.screenHeight);c.fill()});s.label.text=value+"%"};function LoadingSample4(height,background,color){base(this,LSprite,[]);var s=this,c=LGlobal.canvas;s.backgroundColor=background==null?"#000000":background;s.graphics.drawRect(1,s.backgroundColor,[0,0,LGlobal.width,LGlobal.height],true,s.backgroundColor);if(color==null){color="#FFFFFF"}s.arc=new LSprite();s.arc.x=LGlobal.width*0.5;s.arc.y=LGlobal.height*0.5;s.addChild(s.arc);for(var i=0;i<360;i++){s.arc.graphics.drawArc(1+i/36,color,[0,0,50,(2*Math.PI/360)*i,(2*Math.PI/360)*(i+2)])}s.progress=0;s.label=new LTextField();s.label.color=color;s.label.weight="bolder";s.label.size=18;s.label.x=LGlobal.width*0.5;s.label.y=LGlobal.height*0.5-s.label.getHeight()*0.5;s.addChild(s.label);var shadow=new LDropShadowFilter(0,0,"#FFFFFF",30);s.arc.filters=[shadow];s.addEventListener(LEvent.ENTER_FRAME,s.onframe);s.setProgress(s.progress)}LoadingSample4.prototype.onframe=function(event){event.target.arc.rotate+=20};LoadingSample4.prototype.setProgress=function(value){var s=this;if(value>100){value=100}s.progress=value;s.label.text=value+"%";s.label.x=LGlobal.width*0.5-s.label.getWidth()*0.5};function LoadingSample5(height,background,color){base(this,LSprite,[]);var s=this,c=LGlobal.canvas;s.backgroundColor=background==null?"#000000":background;s.graphics.drawRect(1,s.backgroundColor,[0,0,LGlobal.width,LGlobal.height],true,s.backgroundColor);if(color==null){color="#FFFFFF"}s.arc=new LSprite();s.arc.x=LGlobal.width*0.5;s.arc.y=LGlobal.height*0.5;s.addChild(s.arc);var r=50;for(var i=0;i<360;i+=30){var child=new LSprite();child.graphics.drawArc(0,color,[r,0,7,0,2*Math.PI],true,color);child.rotate=i;child.alpha=0.1+i/360;s.arc.addChild(child)}s.index=0;s.max=3;s.progress=0;s.label=new LTextField();s.label.color="#FFFFFF";s.label.weight="bolder";s.label.size=18;s.label.x=LGlobal.width*0.5;s.label.y=LGlobal.height*0.5-s.label.getHeight()*0.5;s.addChild(s.label);var shadow=new LDropShadowFilter(0,0,"#FFFFFF",30); s.arc.filters=[shadow];s.addEventListener(LEvent.ENTER_FRAME,s.onframe);s.setProgress(s.progress)}LoadingSample5.prototype.onframe=function(event){var s=event.target;if(s.index++100){value=100}s.progress=value;s.label.text=value+"%";s.label.x=LGlobal.width*0.5-s.label.getWidth()*0.5};function LoadingSample6(r,color,filterColor){var self=this;base(self,LSprite,[]);self.progress=0;self.step=0;self.holeR=r||10;self.holeAmount=5;self.holesx=20;self.loadingBarWidth=self.holeR*2*self.holeAmount+self.holesx*(self.holeAmount-1);self.loadingBarHeight=self.holeR*2;self.progressColor=color||"#2187e7";self.filterColor=filterColor||"#00c6ff";self.backLayer=new LSprite();self.backLayer.graphics.drawRect(0,"",[0,0,LGlobal.width,LGlobal.height],true,"#161616");self.addChild(self.backLayer);self.holeLayer=new LSprite();self.holeLayer.x=(LGlobal.width-self.loadingBarWidth)*0.5;self.holeLayer.y=(LGlobal.height-self.loadingBarHeight)*0.5;self.addChild(self.holeLayer);self.progressLayer=new LSprite();self.progressLayer.x=(LGlobal.width-self.loadingBarWidth)*0.5;self.progressLayer.y=(LGlobal.height-self.loadingBarHeight)*0.5;self.addChild(self.progressLayer);self._addHole()}LoadingSample6.prototype._addHole=function(){var self=this;var amount=self.holeAmount,sx=self.holeR*2+self.holesx,r=self.holeR;for(var i=0;iself.step){var cw=r*2;var ch=cw;var grd=LGlobal.canvas.createLinearGradient(0,-ch*2,0,ch);grd.addColorStop(0,"white");grd.addColorStop(1,self.progressColor);var po=new LSprite();po.x=self.step*sx;po.scaleX=0;po.scaleY=0;po.graphics.drawArc(0,"",[0,0,r,0,2*Math.PI],true,grd);self.progressLayer.addChild(po);tweenList.push(po);self.step++}var completeFunc=function(o){var circleObj=new LSprite();circleObj.alpha=0.9;circleObj.x=o.x;circleObj.graphics.drawArc(1,self.filterColor,[0,0,r,0,2*Math.PI],false);self.progressLayer.addChild(circleObj);var shadow=new LDropShadowFilter(0,5,self.filterColor,10);circleObj.filters=[shadow];LTweenLite.to(circleObj,0.5,{scaleX:1.7,scaleY:1.7,alpha:0,onComplete:function(s){s.parent.removeChild(s)}})};for(var i=0;iself.step){var n=Math.ceil(self.progress/0.1);if(n>10){n=10}for(var i=0;i0){continue}var o=self.progressLayer.childList[i];LTweenLite.to(o,1,{alpha:1})}self.step++}};var LBox2d=(function(){function LBox2d(gravity,doSleep,drawScale){var s=this;Box2D.Dynamics.b2World.prototype.LAddController=Box2D.Dynamics.b2World.prototype.AddController;Box2D.Dynamics.b2World.prototype.AddController=function(c){var l={},k;for(k in c){l[k]=c[k]}if(LBox2d){LBox2d.m_controllerList=l}return this.LAddController(c)};var i,j,b=Box2D,d,a=[b.Collision,b.Common,b.Common.Math,b.Dynamics,b.Dynamics.Contacts,b.Dynamics.Controllers,b.Dynamics.Joints,b.Collision.Shapes]; for(i in a){for(j in a[i]){s[j]=a[i][j]}}if(typeof drawScale==UNDEFINED){drawScale=30}s.stop=false;s.drawScale=30;s.selectedBody=null;s.mouseJoint=null;s.mousePVec=null;s.contactListener=null;if(typeof gravity==UNDEFINED){gravity=new s.b2Vec2(0,9.8)}else{gravity=new s.b2Vec2(gravity[0],gravity[1])}if(typeof doSleep==UNDEFINED){doSleep=true}s.world=new s.b2World(gravity,doSleep);s.removeList=new Array();if(LGlobal.traceDebug){d=new s.b2DebugDraw();d.SetSprite(LGlobal.canvas);d.SetLineThickness(1);d.SetFillAlpha(0.5);d.SetAlpha(1);d.SetDrawScale(s.drawScale);d.SetFlags(s.b2DebugDraw.e_shapeBit|s.b2DebugDraw.e_jointBit);s.world.SetDebugDraw(d)}LGlobal.destroy=true}LBox2d.prototype={setEvent:function(t_v,f_v){var s=this;if(t_v==LEvent.ENTER_FRAME){s.ll_enterFrame=f_v;return}if(!s.contactListener){s.contactListener=new s.b2ContactListener();s.world.SetContactListener(s.contactListener)}switch(t_v){case LEvent.END_CONTACT:s.contactListener.EndContact=f_v;break;case LEvent.PRE_SOLVE:s.contactListener.PreSolve=f_v;break;case LEvent.POST_SOLVE:s.contactListener.PostSolve=f_v;break;case LEvent.BEGIN_CONTACT:default:s.contactListener.BeginContact=f_v}},setWeldJoint:function(A,B){var s=this;var j=new s.b2WeldJointDef();j.Initialize(B,A,B.GetWorldCenter());return s.world.CreateJoint(j)},setLineJoint:function(A,B,vec,t,m){var s=this;var wa=new s.b2Vec2(vec[0],vec[1]);var j=new s.b2LineJointDef();j.Initialize(A,B,B.GetWorldCenter(),wa);if(t==null){j.enableLimit=false}else{j.lowerTranslation=t[0];j.upperTranslation=t[1];j.enableLimit=true}if(m==null){j.enableMotor=false}else{j.maxMotorForce=m[0];j.motorSpeed=m[1];j.enableMotor=true}return s.world.CreateJoint(j)},setGearJoint:function(A,B,ra,r,p){var s=this;var j=new s.b2GearJointDef();j.joint1=r;j.joint2=p;j.bodyA=A;j.bodyB=B;j.ratio=ra*s.b2Settings.b2_pi/(300/s.drawScale);return s.world.CreateJoint(j)},setPrismaticJoint:function(A,B,vec,t,m){var s=this;var wa=new s.b2Vec2(vec[0],vec[1]);var j=new s.b2PrismaticJointDef();j.Initialize(B,A,B.GetWorldCenter(),wa);if(t==null){j.enableLimit=false}else{j.lowerTranslation=t[0];j.upperTranslation=t[1];j.enableLimit=true}if(m==null){j.enableMotor=false}else{j.maxMotorForce=m[0];j.motorSpeed=m[1];j.enableMotor=true}return s.world.CreateJoint(j)},setRevoluteJoint:function(A,B,a,m){var s=this;var j=new s.b2RevoluteJointDef();j.Initialize(A,B,B.GetWorldCenter());if(a==null){j.enableLimit=false}else{j.lowerAngle=a[0]*s.b2Settings.b2_pi/180;j.upperAngle=a[1]*s.b2Settings.b2_pi/180;j.enableLimit=true}if(m==null){j.enableMotor=false}else{j.maxMotorTorque=m[0];j.motorSpeed=m[1];j.enableMotor=true}return s.world.CreateJoint(j)},setDistanceJoint:function(A,B){var s=this;var j=new s.b2DistanceJointDef();j.Initialize(A,B,A.GetWorldCenter(),B.GetWorldCenter());return s.world.CreateJoint(j)},setPulleyJoint:function(A,B,vA,vB,ratio){var s=this;var a1=A.GetWorldCenter();var a2=B.GetWorldCenter();var g1=new s.b2Vec2(a1.x+(vA[0]/s.drawScale),a1.y+(vA[1]/s.drawScale));var g2=new s.b2Vec2(a2.x+(vB[0]/s.drawScale),a2.y+(vB[1]/s.drawScale));var j=new s.b2PulleyJointDef();j.Initialize(A,B,g1,g2,a1,a2,ratio);j.maxLengthA=vA[2]/s.drawScale;j.maxLengthB=vB[2]/s.drawScale;return s.world.CreateJoint(j)},addCircle:function(r,cx,cy,t,d,f,e){var s=this;s.bodyDef=new s.b2BodyDef;s.bodyDef.type=t;s.fixDef=new s.b2FixtureDef;s.fixDef.density=d;s.fixDef.friction=f;s.fixDef.restitution=e;s.fixDef.shape=new s.b2CircleShape(r);s.bodyDef.position.x=cx;s.bodyDef.position.y=cy;var shape=s.world.CreateBody(s.bodyDef);shape.CreateFixture(s.fixDef);return shape},addPolygon:function(w,h,cx,cy,type,d,f,e){var s=this;s.bodyDef=new s.b2BodyDef;s.bodyDef.type=type;s.fixDef=new s.b2FixtureDef;s.fixDef.density=d;s.fixDef.friction=f;s.fixDef.restitution=e;s.fixDef.shape=new s.b2PolygonShape;s.fixDef.shape.SetAsBox(w,h);s.bodyDef.position.x=cx;s.bodyDef.position.y=cy;var shape=s.world.CreateBody(s.bodyDef);shape.CreateFixture(s.fixDef);return shape},addVertices:function(vertices,type,d,f,e){var s=this,i,l;s.bodyDef=new s.b2BodyDef;s.bodyDef.type=type;var shape=s.world.CreateBody(s.bodyDef);for(i=0,l=vertices.length;i>0}else{self.maxSize=self.child.getHeight()/self.trans.numStrips>>0}var g=new LGraphics();self.child.mask=g;var toSize=self.maxSize;if(self.trans.direction==LTransition.OUT){self.blindsSize=self.maxSize;toSize=0}LTweenLite.to(self,self.trans.duration,{blindsSize:toSize,onComplete:self.blindsComplete,onUpdate:self.blindsUpdate,ease:self.trans.easing})},fadeComplete:function(self){self.child.alpha=self.alpha;if(self.trans.onComplete){self.trans.onComplete(self.child)}},fadeUpdate:function(self){self.child.alpha=self.alpha;if(self.trans.onUpdate){self.trans.onUpdate(self.child)}},fade:function(){var self=this;var toAlpha=1;self.alpha=0;if(self.trans.direction==LTransition.OUT){self.alpha=1;toAlpha=0}self.child.alpha=self.alpha;LTweenLite.to(self,self.trans.duration,{alpha:toAlpha,onComplete:self.fadeComplete,onUpdate:self.fadeUpdate,ease:self.trans.easing})},flyComplete:function(self){self.child.x=self.x;self.child.y=self.y;if(self.trans.onComplete){self.trans.onComplete(self.child)}},flyUpdate:function(self){self.child.x=self.x;self.child.y=self.y;if(self.trans.onUpdate){self.trans.onUpdate(self.child)}},fly:function(){var self=this;var toX=self.child.x;var toY=self.child.y;switch(self.trans.startPoint){case 1:self.x=-self.child.getWidth();self.y=-self.child.getHeight();break;case 2:self.x=(LGlobal.width-self.child.getWidth())*0.5;self.y=-self.child.getHeight();break;case 3:self.x=LGlobal.width;self.y=-self.child.getHeight();break;case 4:self.x=-self.child.getWidth();self.y=(LGlobal.height-self.child.getHeight())*0.5;break;case 6:self.x=LGlobal.width;self.y=(LGlobal.height-self.child.getHeight())*0.5;break;case 7:self.x=-self.child.getWidth();self.y=LGlobal.height;break;case 8:self.x=(LGlobal.width-self.child.getWidth())*0.5;self.y=LGlobal.height;break;case 9:self.x=LGlobal.width;self.y=LGlobal.height;break;case 5:default:self.x=(LGlobal.width-self.child.getWidth())*0.5;self.y=(LGlobal.height-self.child.getHeight())*0.5}if(self.trans.direction==LTransition.OUT){var toX=self.x;var toY=self.y;self.x=self.child.x;self.y=self.child.y}else{self.child.x=self.x;self.child.y=self.y}LTweenLite.to(self,self.trans.duration,{x:toX,y:toY,onComplete:self.flyComplete,onUpdate:self.flyUpdate,ease:self.trans.easing})},irisComplete:function(self){if(self.trans.direction==LTransition.OUT){self.child.mask.clear()}else{self.irisUpdateRun()}self.child.mask=null;if(self.trans.onComplete){self.trans.onComplete(self.child)}},irisUpdateRun:function(){var self=this,g=self.child.mask,c=LGlobal.canvas;g.clear();if(self.trans.shape==LIris.CIRCLE){g.drawArc(0,"#000000",[self.x,self.y,self.r,0,Math.PI*2])}else{g.drawRect(0,"#000000",[self.x+self.sLeft,self.y+self.sTop,self.width,self.height])}},irisUpdate:function(self){self.irisUpdateRun();if(self.trans.onUpdate){self.trans.onUpdate(self.child)}},iris:function(){var self=this;self.sLeft=0;self.sTop=0;self.width=0;self.height=0;self.x=0;self.y=0;self.r=0;self.eWidth=self.child.getWidth();self.eHeight=self.child.getHeight();switch(self.trans.startPoint){case 1:self.eR=Math.sqrt(self.eWidth*self.eWidth+self.eHeight*self.eHeight);break;case 2:self.eR=Math.sqrt((self.eWidth*0.5)*(self.eWidth*0.5)+self.eHeight*self.eHeight);self.x=self.child.getWidth()*0.5;break;case 3:self.eR=Math.sqrt(self.eWidth*self.eWidth+self.eHeight*self.eHeight);self.x=self.child.getWidth();break;case 4:self.eR=Math.sqrt(self.eWidth*self.eWidth+(self.eHeight*0.5)*(self.eHeight*0.5));self.y=self.child.getHeight()*0.5;break;case 6:self.eR=Math.sqrt(self.eWidth*self.eWidth+(self.eHeight*0.5)*(self.eHeight*0.5));self.x=self.child.getWidth();self.y=self.child.getHeight()*0.5;break;case 7:self.eR=Math.sqrt(self.eWidth*self.eWidth+self.eHeight*self.eHeight);self.y=self.child.getHeight();break;case 8:self.eR=Math.sqrt((self.eWidth*0.5)*(self.eWidth*0.5)+self.eHeight*self.eHeight);self.x=self.child.getWidth()*0.5;self.y=self.child.getHeight();break;case 9:self.eR=Math.sqrt(self.eWidth*self.eWidth+self.eHeight*self.eHeight);self.x=self.child.getWidth();self.y=self.child.getHeight();break;case 5:default:self.eR=Math.sqrt((self.eWidth*0.5)*(self.eWidth*0.5)+(self.eHeight*0.5)*(self.eHeight*0.5));self.x=self.child.getWidth()*0.5;self.y=self.child.getHeight()*0.5}self.eLeft=-self.x;self.eTop=-self.y;var g=new LGraphics();self.child.mask=g;var toSize=self.maxSize;if(self.trans.direction==LTransition.OUT){self.sLeft=self.eLeft;self.sTop=self.eTop;self.eLeft=0;self.eTop=0;self.width=self.eWidth;self.height=self.eHeight;self.eWidth=0;self.eHeight=0;self.r=self.eR;self.eR=0}LTweenLite.to(self,self.trans.duration,{width:self.eWidth,height:self.eHeight,sLeft:self.eLeft,sTop:self.eTop,r:self.eR,onComplete:self.irisComplete,onUpdate:self.irisUpdate,ease:self.trans.easing}) },curtainComplete:function(self){if(self.trans.direction==LTransition.OUT){self.child.mask.clear()}else{self.curtainUpdateRun()}self.child.mask=null;if(self.trans.onComplete){self.trans.onComplete(self.child)}},curtainUpdateRun:function(){var self=this,g=self.child.mask,c=LGlobal.canvas;g.clear();if(self.trans.dimension){g.add(function(){c.save();c.rect(0,0,self.width,self.child.getHeight());c.rect(self.child.getWidth()-self.width,0,self.width,self.child.getHeight());c.restore()})}else{g.add(function(){c.save();c.rect(0,0,self.child.getWidth(),self.height);c.rect(0,self.child.getHeight()-self.height,self.child.getWidth(),self.height);c.restore()})}},curtainUpdate:function(self){self.curtainUpdateRun();if(self.trans.onUpdate){self.trans.onUpdate(self.child)}},curtain:function(){var self=this;var eW=self.child.getWidth()*0.5;var eH=self.child.getHeight()*0.5;if(self.trans.dimension){eH=0}else{eW=0}self.width=0;self.height=0;var g=new LGraphics();self.child.mask=g;var toSize=self.maxSize;if(self.trans.direction==LTransition.OUT){self.width=eW;self.height=eH;eW=0;eH=0}LTweenLite.to(self,self.trans.duration,{width:eW,height:eH,onComplete:self.curtainComplete,onUpdate:self.curtainUpdate,ease:self.trans.easing})},squeezeComplete:function(self){self.child.scaleX=self.scaleX;self.child.scaleY=self.scaleY;if(self.trans.onComplete){self.trans.onComplete(self.child)}},squeezeUpdate:function(self){self.child.scaleX=self.scaleX;self.child.scaleY=self.scaleY;if(self.trans.onUpdate){self.trans.onUpdate(self.child)}},squeeze:function(){var self=this;var toScaleX=1,toScaleY=1;self.scaleX=0,self.scaleY=0;if(self.trans.dimension){self.scaleX=1}else{self.scaleY=1}if(self.trans.direction==LTransition.OUT){toScaleX=self.scaleX,toScaleY=self.scaleY;self.scaleX=1,self.scaleY=1}self.child.scaleX=self.scaleX;self.child.scaleY=self.scaleY;LTweenLite.to(self,self.trans.duration,{scaleX:toScaleX,scaleY:toScaleY,onComplete:self.squeezeComplete,onUpdate:self.squeezeUpdate,ease:self.trans.easing})},zoomComplete:function(self){self.child.scaleX=self.scaleX;self.child.scaleY=self.scaleY;if(self.trans.onComplete){self.trans.onComplete(self.child)}},zoomUpdate:function(self){self.child.scaleX=self.scaleX;self.child.scaleY=self.scaleY;if(self.trans.onUpdate){self.trans.onUpdate(self.child)}},zoom:function(){var self=this;var toScaleX=1,toScaleY=1;self.scaleX=0,self.scaleY=0;if(self.trans.direction==LTransition.OUT){toScaleX=0,toScaleY=0;self.scaleX=1,self.scaleY=1}self.child.scaleX=self.scaleX;self.child.scaleY=self.scaleY;LTweenLite.to(self,self.trans.duration,{scaleX:toScaleX,scaleY:toScaleY,onComplete:self.zoomComplete,onUpdate:self.zoomUpdate,ease:self.trans.easing})},wipeComplete:function(self){if(self.trans.direction==LTransition.OUT){self.child.mask.clear()}else{self.wipeUpdateRun()}self.child.mask=null;if(self.trans.onComplete){self.trans.onComplete(self.child)}},wipeUpdateRun:function(){var self=this,g=self.child.mask,c=LGlobal.canvas;g.clear();g.drawVertices(0,"#000000",[[self.leftTopX,self.leftTopY],[self.leftBottomX,self.leftBottomY],[self.rightBottomX,self.rightBottomY],[self.rightTopX,self.rightTopY]])},wipeUpdate:function(self){self.wipeUpdateRun();if(self.trans.onUpdate){self.trans.onUpdate(self.child)}},wipe:function(){var self=this,w=self.child.getWidth(),h=self.child.getHeight(),ltX=self.leftTopX=0,ltY=self.leftTopY=0,lbX=self.leftBottomX=0,lbY=self.leftBottomY=h,rtX=self.rightTopX=w,rtY=self.rightTopY=0,rbX=self.rightBottomX=w,rbY=self.rightBottomY=h;switch(self.trans.startPoint){case 1:ltX=self.leftTopX=-w;lbX=self.leftBottomX=-w*2;self.rightTopX=0;rtX=w*2;self.rightBottomX=-w;rbX=w;break;case 2:ltY=self.leftTopY=-h;self.leftBottomY=0;lbY=h;rtY=self.rightTopY=-h;self.rightBottomY=0;rbY=h;break;case 3:self.leftTopX=w;ltX=-w;self.leftBottomX=w*2;lbX=0;rtX=self.rightTopX=w*2;rbX=self.rightBottomX=w*3;break;case 4:self.rightTopX=0;rtX=w;self.rightBottomX=0;rbX=w;break;case 6:self.leftTopX=w;ltX=0;self.leftBottomX=w;lbX=0;break;case 7:lbX=self.leftBottomX=-w;ltX=self.leftTopX=-w*2;self.rightBottomX=0;rbX=w*2;self.rightTopX=-w;rtX=w;break;case 8:lbY=self.leftBottomY=h;self.leftTopY=h;ltY=0;rbY=self.rightBottomY=h;self.rightTopY=h;rtY=0;break;case 9:self.leftBottomX=w;lbX=-w;self.leftTopX=w*2;ltX=0;rbX=self.rightBottomX=w*2;rtX=self.rightTopX=w*3;break;case 5:default:self.leftTopX=w*0.5;self.leftTopY=h*0.5;self.rightTopX=w*0.5;self.rightTopY=h*0.5;self.leftBottomX=w*0.5;self.leftBottomY=h*0.5;self.rightBottomX=w*0.5;self.rightBottomY=h*0.5;ltX=0,ltY=0;lbX=0,lbY=h;rtX=w,rtY=0;rbX=w,rbY=h}var g=new LGraphics();self.child.mask=g;if(self.trans.direction==LTransition.OUT){var oltX=ltX,oltY=ltY,olbX=lbX,olbY=lbY,ortX=rtX,ortY=rtY,orbX=rbX,orbY=rbY;ltX=self.leftTopX,ltY=self.leftTopY,lbX=self.leftBottomX,lbY=self.leftBottomY,rtX=self.rightTopX,rtY=self.rightTopY,rbX=self.rightBottomX,rbY=self.rightBottomY;self.leftTopX=oltX,self.leftTopY=oltY,self.leftBottomX=olbX,self.leftBottomY=olbY,self.rightTopX=ortX,self.rightTopY=ortY,self.rightBottomX=orbX,self.rightBottomY=orbY }LTweenLite.to(self,self.trans.duration,{leftTopX:ltX,leftTopY:ltY,leftBottomX:lbX,leftBottomY:lbY,rightTopX:rtX,rightTopY:rtY,rightBottomX:rbX,rightBottomY:rbY,onComplete:self.wipeComplete,onUpdate:self.wipeUpdate,ease:self.trans.easing})},pixelDissolveComplete:function(self){if(self.trans.direction==LTransition.OUT){self.child.mask.clear()}else{self.pixelDissolveUpdateRun()}self.child.mask=null;if(self.trans.onComplete){self.trans.onComplete(self.child)}},pixelDissolveUpdateRun:function(){var self=this,g=self.child.mask,c=LGlobal.canvas,list;g.clear();g.add(function(){c.save();for(var i=0;i0.5});self.pixelDissolveUpdateRun();LTweenLite.to(self,self.trans.duration,{index:to,onComplete:self.pixelDissolveComplete,onUpdate:self.pixelDissolveUpdate,ease:self.trans.easing})}};LTransition.IN="in";LTransition.OUT="out";LTransition.Blinds=1;LTransition.Fade=2;LTransition.Fly=3;LTransition.Iris=4;LTransition.Curtain=5;LTransition.PixelDissolve=6;LTransition.Squeeze=7;LTransition.Wipe=8;LTransition.Zoom=9;return LTransition})();var LIris=(function(){function LIris(){}LIris.SQUARE=0;LIris.CIRCLE=1;return LIris})();var LTransitionManager=(function(){function LTransitionManager(displayObject){this.child=displayObject}LTransitionManager.prototype={startTransition:function(transParams){return LTransitionManager.start(this.child,transParams)}};LTransitionManager.start=function(displayObject,transParams){var trans=new LTransition(displayObject,transParams);trans.startTransition();return trans};return LTransitionManager})();var LFlash=(function(){function LFlash(){}LFlash.SpriteSheetConvert=function(frames){var result=[],child;for(var i=0;i