Permalink
Browse files

Final updates before v0.5.0 release. Addition of MouseInteraction tut…

…orial.

Signed-off-by: Grant Skinner <info@gskinner.com>
  • Loading branch information...
1 parent cd7603c commit 0af02d80a4199f9ebea3ec8d5a3158bfae9b5fee @gskinner gskinner committed Aug 24, 2012
Showing with 592 additions and 144 deletions.
  1. +1 −1 CREATEJS_NAMESPACE.txt → README_CREATEJS_NAMESPACE.txt
  2. 0 SECURITY_ERROR_README.txt → README_SECURITY_ERROR.txt
  3. +1 −1 VERSIONS.txt
  4. BIN docs/EaselJS_docs-0.4.2.zip
  5. BIN docs/EaselJS_docs-0.5.0.zip
  6. BIN docs/EaselJS_docs-NEXT.zip
  7. +2 −2 examples/Game.html
  8. +1 −1 examples/Icons.html
  9. +3 −3 examples/SpriteSheet.html
  10. +1 −1 examples/SpriteSheetBuilderMC/SpriteSheetBuilder_MovieClip.html
  11. +2 −1 examples/Transform.html
  12. +45 −0 examples/assets/preloadjs-0.2.0.min.js
  13. +36 −0 examples/assets/soundjs-0.3.0.min.js
  14. 0 examples/assets/{tweenjs-0.2.0.min.js → tweenjs-0.3.0.min.js}
  15. +0 −89 lib/easeljs-0.4.2.min.js
  16. 0 lib/{easeljs-NEXT.min.js → easeljs-0.5.0.min.js}
  17. +0 −17 lib/movieclip-0.4.1.min.js
  18. +18 −0 lib/movieclip-0.5.0.min.js
  19. +0 −17 lib/movieclip-NEXT.min.js
  20. +2 −0 tutorials/Animation and Ticker/index.html
  21. +1 −1 tutorials/Animation and Ticker/onTick.html
  22. +1 −1 tutorials/Animation and Ticker/pausing.html
  23. +1 −1 tutorials/Animation and Ticker/simple.html
  24. +1 −1 tutorials/Animation and Ticker/timeBased.html
  25. +1 −1 tutorials/Getting Started/demo.html
  26. +1 −1 tutorials/Getting Started/index.html
  27. +1 −1 tutorials/HitTest/globalToLocal.html
  28. +1 −1 tutorials/HitTest/hitTest.html
  29. +1 −1 tutorials/HitTest/localToLocal.html
  30. +1 −1 tutorials/Inheritance/demo.html
  31. +30 −0 tutorials/Mouse Interaction/basic.html
  32. +54 −0 tutorials/Mouse Interaction/container.html
  33. +50 −0 tutorials/Mouse Interaction/drag.html
  34. +53 −0 tutorials/Mouse Interaction/events.html
  35. +42 −0 tutorials/Mouse Interaction/hitArea.html
  36. +184 −0 tutorials/Mouse Interaction/index.html
  37. +52 −0 tutorials/Mouse Interaction/stage.html
  38. +5 −1 tutorials/shared/demo.css
View
2 CREATEJS_NAMESPACE.txt → README_CREATEJS_NAMESPACE.txt
@@ -1,4 +1,4 @@
-In the NEXT version of CreateJS class definitions reside in a "createjs" namespace by default.
+In this version of CreateJS class definitions reside in a "createjs" namespace by default.
For example, instead of instantiating a Shape like this:
var foo = new Shape();
View
0 SECURITY_ERROR_README.txt → README_SECURITY_ERROR.txt
File renamed without changes.
View
2 VERSIONS.txt
@@ -1,4 +1,4 @@
-Version NEXT [release TBD]
+Version 0.5.0 [Aug 24, 2012]
****************************************************************************************************
- moved all classes into a configurable createjs namespace
- added support for multitouch
View
BIN docs/EaselJS_docs-0.4.2.zip
Binary file not shown.
View
BIN docs/EaselJS_docs-0.5.0.zip
Binary file not shown.
View
BIN docs/EaselJS_docs-NEXT.zip
Binary file not shown.
View
4 examples/Game.html
@@ -12,8 +12,8 @@
var createjs = window;
</script>
- <script type="text/javascript" src="http://code.createjs.com/preloadjs-0.1.0.min.js"></script>
- <script type="text/javascript" src="http://code.createjs.com/soundjs-0.2.0.min.js"></script>
+ <script type="text/javascript" src="assets/preloadjs-0.2.0.min.js"></script>
+ <script type="text/javascript" src="assets/soundjs-0.3.0.min.js"></script>
<script type="text/javascript" src="../src/easeljs/utils/UID.js"></script>
<script type="text/javascript" src="../src/easeljs/geom/Matrix2D.js"></script>
View
2 examples/Icons.html
@@ -56,7 +56,7 @@
icon2.gotoAndStop(5);
stage.addChild(icon2);
- /*** NEXT: the more robust approach ***/
+ /*** Next: the more robust approach ***/
// define sprite sheet data describing the available icons:
// we can use the form {frameName:frameNumber} in animations because each "sequence" is only a single frame:
var data = {
View
6 examples/SpriteSheet.html
@@ -14,7 +14,7 @@
var createjs = window;
</script>
- <script src="http://code.createjs.com/preloadjs-0.1.0.min.js"></script>
+ <script src="assets/preloadjs-0.2.0.min.js"></script>
<script type="text/javascript" src="../src/easeljs/utils/UID.js"></script>
<script type="text/javascript" src="../src/easeljs/geom/Matrix2D.js"></script>
@@ -88,14 +88,14 @@
];
loader = new PreloadJS();
- //loader.useXHR = false; //Loads the images using tag loading.
+ loader.useXHR = false; // XHR loading is not reliable when running locally.
loader.onFileLoad = handleFileLoad;
loader.onComplete = handleComplete;
loader.loadManifest(manifest);
stage.autoClear = false;
}
- function handleFileLoad(event) {crazy
+ function handleFileLoad(event) {
assets.push(event);
}
View
2 examples/SpriteSheetBuilderMC/SpriteSheetBuilder_MovieClip.html
@@ -26,7 +26,7 @@
<script type="text/javascript" src="../../src/easeljs/utils/SpriteSheetBuilder.js"></script>
<script type="text/javascript" src="../../src/easeljs/display/Text.js"></script>
- <script src="../assets/tweenjs-0.2.0.min.js"></script> <!-- required for MovieClip -->
+ <script src="../assets/tweenjs-0.3.0.min.js"></script> <!-- required for MovieClip -->
<script type="text/javascript" src="../../src/easeljs/display/MovieClip.js"></script>
<script src="gunnertron_g.js"></script>
View
3 examples/Transform.html
@@ -12,7 +12,7 @@
var createjs = window;
</script>
- <script src="http://code.createjs.com/preloadjs-0.1.0.min.js"></script>
+ <script src="assets/preloadjs-0.2.0.min.js"></script>
<script type="text/javascript" src="../src/easeljs/utils/UID.js"></script>
<script type="text/javascript" src="../src/easeljs/geom/Matrix2D.js"></script>
@@ -79,6 +79,7 @@
];
loader = new PreloadJS();
+ loader.useXHR = false; // XHR loading is not reliable when running locally.
loader.onProgress = handleProgress;
loader.onComplete = handleComplete;
loader.onFileLoad = handleFileLoad;
View
45 examples/assets/preloadjs-0.2.0.min.js
@@ -0,0 +1,45 @@
+/**
+* PreloadJS
+* Visit http://createjs.com/ for documentation, updates and examples.
+*
+* Copyright (c) 2011 gskinner.com, inc.
+*
+* Distributed under the terms of the MIT license.
+* http://www.opensource.org/licenses/mit-license.html
+*
+* This notice shall be included in all copies or substantial portions of the Software.
+**/this.createjs=this.createjs||{};
+(function(){var d=function(){this.init()};d.prototype={};var a=d.prototype;a.loaded=false;a.canceled=false;a.progress=0;a._item=null;a.onProgress=null;a.onLoadStart=null;a.onFileLoad=null;a.onFileProgress=null;a.onComplete=null;a.onError=null;a.getItem=function(){return this._item};a.init=function(){};a.load=function(){};a.cancel=function(){};a._sendLoadStart=function(){if(!this._isCanceled()&&this.onLoadStart)this.onLoadStart({target:this})};a._sendProgress=function(a){if(!this._isCanceled()){var b;if(a instanceof
+Number)this.progress=a,b={loaded:this.progress,total:1};else if(b=a,this.progress=a.loaded/a.total,isNaN(this.progress)||this.progress==Infinity)this.progress=0;b.target=this;if(this.onProgress)this.onProgress(b)}};a._sendFileProgress=function(a){if(this._isCanceled())this._cleanUp();else if(this.onFileProgress)a.target=this,this.onFileProgress(a)};a._sendComplete=function(){if(!this._isCanceled()&&this.onComplete)this.onComplete({target:this})};a._sendFileComplete=function(a){if(!this._isCanceled()&&
+this.onFileLoad)a.target=this,this.onFileLoad(a)};a._sendError=function(a){if(!this._isCanceled()&&this.onError)a==null&&(a={}),a.target=this,this.onError(a)};a._isCanceled=function(){return window.createjs==null||this.canceled?true:false};a.toString=function(){return"[PreloadJS AbstractLoader]"};createjs.AbstractLoader=d})();this.createjs=this.createjs||{};
+(function(){var d=function(b){this.initialize(b)},a=d.prototype=new createjs.AbstractLoader;d.IMAGE="image";d.SVG="svg";d.SOUND="sound";d.JSON="json";d.JAVASCRIPT="javascript";d.CSS="css";d.XML="xml";d.TEXT="text";d.TIMEOUT_TIME=8E3;a.useXHR=true;a.stopOnError=false;a.maintainScriptOrder=true;a.next=null;a.typeHandlers=null;a.extensionHandlers=null;a._loadStartWasDispatched=false;a._maxConnections=1;a._currentLoads=null;a._loadQueue=null;a._loadedItemsById=null;a._loadedItemsBySrc=null;a._targetProgress=
+0;a._numItems=0;a._numItemsLoaded=null;a._scriptOrder=null;a._loadedScripts=null;a.TAG_LOAD_OGGS=true;a.initialize=function(b){this._targetProgress=this._numItemsLoaded=this._numItems=0;this._paused=false;this._currentLoads=[];this._loadQueue=[];this._scriptOrder=[];this._loadedScripts=[];this._loadedItemsById={};this._loadedItemsBySrc={};this.typeHandlers={};this.extensionHandlers={};this._loadStartWasDispatched=false;this.useXHR=b!=false&&window.XMLHttpRequest!=null;this.determineCapabilities()};
+a.determineCapabilities=function(){var b=createjs.PreloadJS.BrowserDetect;if(b!=null)createjs.PreloadJS.TAG_LOAD_OGGS=b.isFirefox||b.isOpera};d.isBinary=function(b){switch(b){case createjs.PreloadJS.IMAGE:case createjs.PreloadJS.SOUND:return true;default:return false}};a.installPlugin=function(b){if(!(b==null||b.getPreloadHandlers==null)){b=b.getPreloadHandlers();if(b.types!=null)for(var a=0,c=b.types.length;a<c;a++)this.typeHandlers[b.types[a]]=b.callback;if(b.extensions!=null)for(a=0,c=b.extensions.length;a<
+c;a++)this.extensionHandlers[b.extensions[a]]=b.callback}};a.setMaxConnections=function(b){this._maxConnections=b;this._paused||this._loadNext()};a.loadFile=function(b,a){b==null?this._sendError({text:"File is null."}):(this._addItem(b),a!==false&&this.setPaused(false))};a.loadManifest=function(b,a){var c;if(b instanceof Array){if(b.length==0){this._sendError({text:"Manifest is empty."});return}c=b}else{if(b==null){this._sendError({text:"Manifest is null."});return}c=[b]}for(var d=0,f=c.length;d<
+f;d++)this._addItem(c[d],false);a!==false&&this._loadNext()};a.load=function(){this.setPaused(false)};a.getResult=function(b){return this._loadedItemsById[b]||this._loadedItemsBySrc[b]};a.setPaused=function(b){(this._paused=b)||this._loadNext()};a.close=function(){for(;this._currentLoads.length;)this._currentLoads.pop().cancel();this._scriptOrder.length=0;this._loadedScripts.length=0};a._addItem=function(b){b=this._createLoadItem(b);b!=null&&(this._loadQueue.push(b),this._numItems++,this._updateProgress(),
+b.getItem().type==createjs.PreloadJS.JAVASCRIPT&&(this._scriptOrder.push(b.getItem()),this._loadedScripts.push(null)))};a._loadNext=function(){if(!this._paused){if(!this._loadStartWasDispatched)this._sendLoadStart(),this._loadStartWasDispatched=true;if(this._numItems==this._numItemsLoaded)this.loaded=true,this._sendComplete(),this.next&&this.next.load&&this.next.load.apply(this.next);for(;this._loadQueue.length&&this._currentLoads.length<this._maxConnections;)this._loadItem(this._loadQueue.shift())}};
+a._loadItem=function(b){b.onProgress=createjs.PreloadJS.proxy(this._handleProgress,this);b.onComplete=createjs.PreloadJS.proxy(this._handleFileComplete,this);b.onError=createjs.PreloadJS.proxy(this._handleFileError,this);this._currentLoads.push(b);b.load()};a._handleFileError=function(b){var b=b.target,a=this._createResultData(b.getItem());this._numItemsLoaded++;this._updateProgress();this._sendError(a);this.stopOnError||(this._removeLoadItem(b),this._loadNext())};a._createResultData=function(b){var a=
+{id:b.id,result:null,data:b.data,type:b.type,src:b.src};this._loadedItemsById[b.id]=a;return this._loadedItemsBySrc[b.src]=a};a._handleFileComplete=function(b){var b=b.target,a=b.getItem(),c=this._createResultData(a);this._removeLoadItem(b);c.result=b instanceof createjs.XHRLoader?this._createResult(a,b.getResult()):a.tag;switch(a.type){case createjs.PreloadJS.IMAGE:if(b instanceof createjs.XHRLoader){var d=this;c.result.onload=function(){d._handleFileTagComplete(a,c)};return}break;case createjs.PreloadJS.JAVASCRIPT:if(this.maintainScriptOrder){this._loadedScripts[this._scriptOrder.indexOf(a)]=
+a;this._checkScriptLoadOrder(b);return}}this._handleFileTagComplete(a,c)};a._checkScriptLoadOrder=function(){for(var b=this._loadedScripts.length,a=0;a<b;a++){var c=this._loadedScripts[a];if(c===null)break;if(c!==true){var d=this.getResult(c.src),c=this.getResult(c.id);c.result=d.result;this._handleFileTagComplete(d,c);this._loadedScripts[a]=true;a--;b--}}};a._handleFileTagComplete=function(b,a){this._numItemsLoaded++;b.completeHandler&&b.completeHandler(a);this._updateProgress();this._sendFileComplete(a);
+this._loadNext()};a._removeLoadItem=function(b){for(var a=this._currentLoads.length,c=0;c<a;c++)if(this._currentLoads[c]==b){this._currentLoads.splice(c,1);break}};a._createResult=function(b,a){var c=null,d;switch(b.type){case createjs.PreloadJS.IMAGE:c=this._createImage();break;case createjs.PreloadJS.SOUND:c=b.tag||this._createAudio();break;case createjs.PreloadJS.CSS:c=this._createLink();break;case createjs.PreloadJS.JAVASCRIPT:c=this._createScript();break;case createjs.PreloadJS.SVG:var c=this._createSVG(),
+f=this._createXML(a,"image/svg+xml");c.appendChild(f);break;case createjs.PreloadJS.XML:d=this._createXML(a,"text/xml");break;case createjs.PreloadJS.JSON:case createjs.PreloadJS.TEXT:d=a}if(c){if(b.type==createjs.PreloadJS.CSS)c.href=b.src;else if(b.type!=createjs.PreloadJS.SVG)c.src=b.src;return c}else return d};a._createXML=function(b,a){var c;window.DOMParser?(c=new DOMParser,c=c.parseFromString(b,a)):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async=false,c.loadXML(b));return c};a._handleProgress=
+function(b){var b=b.target,a=this._createResultData(b.getItem());a.progress=b.progress;this._sendFileProgress(a);this._updateProgress()};a._updateProgress=function(){var b=this._numItemsLoaded/this._numItems,a=this._numItems-this._numItemsLoaded;if(a>0){for(var c=0,d=0,f=this._currentLoads.length;d<f;d++)c+=this._currentLoads[d].progress;b+=c/a*(a/this._numItems)}this._sendProgress({loaded:b,total:1})};a._createLoadItem=function(a){var c={};switch(typeof a){case "string":c.src=a;break;case "object":a instanceof
+HTMLAudioElement?(c.tag=a,c.src=c.tag.src,c.type=createjs.PreloadJS.SOUND):c=a}c.ext=this._getNameAfter(c.src,".");if(!c.type)c.type=this.getType(c.ext);if(c.id==null||c.id=="")c.id=c.src;if(a=this.typeHandlers[c.type]||this.extensionHandlers[c.ext]){a=a(c.src,c.type,c.id,c.data);if(a===false)return null;else if(a!==true){if(a.src!=null)c.src=a.src;if(a.id!=null)c.id=a.id;if(a.tag!=null&&a.tag.load instanceof Function)c.tag=a.tag}c.ext=this._getNameAfter(c.src,".")}a=this.useXHR;switch(c.type){case createjs.PreloadJS.JSON:case createjs.PreloadJS.XML:case createjs.PreloadJS.TEXT:a=
+true;break;case createjs.PreloadJS.SOUND:c.ext=="ogg"&&createjs.PreloadJS.TAG_LOAD_OGGS&&(a=false)}return this.useXHR==true&&(c.type==createjs.PreloadJS.IMAGE||c.type==createjs.PreloadJS.SVG)?(c=this._createTagItem(c),c.useXHR=true,c):a?new createjs.XHRLoader(c):c.tag?new createjs.TagLoader(c):this._createTagItem(c)};a._createTagItem=function(a){var c,d="src",e=false;switch(a.type){case createjs.PreloadJS.IMAGE:c=this._createImage();break;case createjs.PreloadJS.SOUND:c=this._createAudio();break;
+case createjs.PreloadJS.CSS:d="href";e=true;c=this._createLink();break;case createjs.PreloadJS.JAVASCRIPT:e=true;c=this._createScript();break;case createjs.PreloadJS.SVG:d="data",c=this._createSVG()}a.tag=c;return new createjs.TagLoader(a,d,e)};a.getType=function(a){switch(a){case "jpeg":case "jpg":case "gif":case "png":return createjs.PreloadJS.IMAGE;case "ogg":case "mp3":case "wav":return createjs.PreloadJS.SOUND;case "json":return createjs.PreloadJS.JSON;case "xml":return createjs.PreloadJS.XML;
+case "css":return createjs.PreloadJS.CSS;case "js":return createjs.PreloadJS.JAVASCRIPT;case "svg":return createjs.PreloadJS.SVG;default:return createjs.PreloadJS.TEXT}};a._getNameAfter=function(a,c){var d=a.lastIndexOf(c),d=a.substr(d+1),e=d.lastIndexOf(/[\b|\?|\#|\s]/);return e==-1?d:d.substr(0,e)};a._createImage=function(){return document.createElement("img")};a._createSVG=function(){var a=document.createElement("object");a.type="image/svg+xml";return a};a._createAudio=function(){var a=document.createElement("audio");
+a.autoplay=false;a.type="audio/ogg";return a};a._createScript=function(){var a=document.createElement("script");a.type="text/javascript";return a};a._createLink=function(){var a=document.createElement("link");a.type="text/css";a.rel="stylesheet";return a};a.toString=function(){return"[PreloadJS]"};d.proxy=function(a,c){return function(d){return a.apply(c,arguments)}};createjs.PreloadJS=d;var c=function(){};c.init=function(){var a=navigator.userAgent;c.isFirefox=a.indexOf("Firefox")>-1;c.isOpera=window.opera!=
+null;c.isIOS=a.indexOf("iPod")>-1||a.indexOf("iPhone")>-1||a.indexOf("iPad")>-1};c.init();createjs.PreloadJS.BrowserDetect=c})();this.createjs=this.createjs||{};
+(function(){var d=function(a,b,d){this.init(a,b,d)},a=d.prototype=new createjs.AbstractLoader;a._srcAttr=null;a._loadTimeOutTimeout=null;a.tagCompleteProxy=null;a.init=function(a,b,d){this._item=a;this._srcAttr=b||"src";this.useXHR=d==true;this.isAudio=a.tag instanceof HTMLAudioElement;this.tagCompleteProxy=createjs.PreloadJS.proxy(this._handleTagLoad,this)};a.cancel=function(){this.canceled=true;this._clean();var a=this.getItem();if(a!=null)a.src=null};a.load=function(){this.useXHR?this.loadXHR():
+this.loadTag()};a.loadXHR=function(){var a=this.getItem(),a=new createjs.XHRLoader(a);a.onProgress=createjs.PreloadJS.proxy(this._handleProgress,this);a.onFileLoad=createjs.PreloadJS.proxy(this._handleXHRComplete,this);a.onComplete=createjs.PreloadJS.proxy(this._handleXHRComplete,this);a.onError=createjs.PreloadJS.proxy(this._handleLoadError,this);a.load()};a._handleXHRComplete=function(a){if(!this._isCanceled()){this._clean();a.target.onFileLoad=null;a.target.onComplete=null;var b=a.target.getItem();
+a.target.getResult();b.type==createjs.PreloadJS.IMAGE?(b.tag.onload=createjs.PreloadJS.proxy(this._sendComplete,this),b.tag.src=b.src):(b.tag[this._srcAttr]=b.src,this._sendComplete())}};a._handleLoadError=function(a){a.error&&a.error.code==101?this.loadTag():(this._clean(),this._sendError(a))};a.loadTag=function(){var a=this.getItem(),b=a.tag;clearTimeout(this._loadTimeOutTimeout);this._loadTimeOutTimeout=setTimeout(createjs.PreloadJS.proxy(this._handleLoadTimeOut,this),createjs.PreloadJS.TIMEOUT_TIME);
+if(this.isAudio)b.src=null,b.preload="auto",b.setAttribute("data-temp","true");b.onerror=createjs.PreloadJS.proxy(this._handleLoadError,this);b.onprogress=createjs.PreloadJS.proxy(this._handleProgress,this);this.isAudio?(b.onstalled=createjs.PreloadJS.proxy(this._handleStalled,this),b.addEventListener("canplaythrough",this.tagCompleteProxy,false)):b.onload=createjs.PreloadJS.proxy(this._handleTagLoad,this);b[this._srcAttr]=a.src;a.type==createjs.PreloadJS.SVG&&document.getElementsByTagName("body")[0].appendChild(b);
+a=a.type==createjs.PreloadJS.SOUND&&a.ext=="ogg"&&createjs.PreloadJS.BrowserDetect.isFirefox;b.load!=null&&!a&&b.load()};a._handleLoadTimeOut=function(){this._clean();this._sendError()};a._handleStalled=function(){};a._handleLoadError=function(){this._clean();this._sendError()};a._handleTagLoad=function(){if(!this._isCanceled()){var a=this.getItem().tag;clearTimeout(this._loadTimeOutTimeout);if(!(this.loaded||this.isAudio&&a.readyState!==4))this.getItem().type==createjs.PreloadJS.SVG&&document.getElementsByTagName("body")[0].removeChild(a),
+this.loaded=true,this._clean(),this._sendComplete()}};a._clean=function(){clearTimeout(this._loadTimeOutTimeout);var a=this.getItem().tag;a.onload=null;a.removeEventListener&&a.removeEventListener("canplaythrough",this.tagCompleteProxy,false);a.onstalled=null;a.onprogress=null;a.onerror=null};a._handleProgress=function(a){clearTimeout(this._loadTimeOutTimeout);if(this.isAudio){a=this.getItem();if(a.buffered==null)return;a={loaded:a.buffered.length>0?a.buffered.end(0):0,total:a.duration}}this._sendProgress(a)};
+a.toString=function(){return"[PreloadJS TagLoader]"};createjs.TagLoader=d})();this.createjs=this.createjs||{};
+(function(){var d=function(a){this.init(a)},a=d.prototype=new createjs.AbstractLoader;a._wasLoaded=false;a._request=null;a._loadTimeOutTimeout=null;a._xhrLevel=null;a.init=function(a){this._item=a;this._createXHR(a)};a.getResult=function(){try{return this._request.responseText}catch(a){}return this._request.response};a.cancel=function(){this.canceled=true;this._clean();this._request.abort()};a.load=function(){if(this._request==null)this.handleError();else{if(this._xhrLevel==1)this._loadTimeOutTimeout=
+setTimeout(createjs.PreloadJS.proxy(this.handleTimeout,this),createjs.PreloadJS.TIMEOUT_TIME);this._request.onloadstart=createjs.PreloadJS.proxy(this.handleLoadStart,this);this._request.onprogress=createjs.PreloadJS.proxy(this.handleProgress,this);this._request.onabort=createjs.PreloadJS.proxy(this.handleAbort,this);this._request.onerror=createjs.PreloadJS.proxy(this.handleError,this);this._request.ontimeout=createjs.PreloadJS.proxy(this.handleTimeout,this);this._request.onload=createjs.PreloadJS.proxy(this.handleLoad,
+this);this._request.onreadystatechange=createjs.PreloadJS.proxy(this.handleReadyStateChange,this);try{this._request.send()}catch(a){this._sendError({source:a})}}};a.handleProgress=function(a){a.loaded>0&&a.total==0||this._sendProgress({loaded:a.loaded,total:a.total})};a.handleLoadStart=function(){clearTimeout(this._loadTimeOutTimeout);this._sendLoadStart()};a.handleAbort=function(){this._clean();this._sendError()};a.handleError=function(){this._clean();this._sendError()};a.handleReadyStateChange=
+function(){this._request.readyState==4&&this.handleLoad()};a._checkError=function(){switch(parseInt(this._request.status)){case 404:case 0:return false}return this._hasResponse()||this._hasTextResponse()||this._hasXMLResponse()};a._hasResponse=function(){return this._request.response!=null};a._hasTextResponse=function(){try{return this._request.responseText!=null}catch(a){return false}};a._hasXMLResponse=function(){try{return this._request.responseXML!=null}catch(a){return false}};a.handleLoad=function(){if(!this.loaded)this.loaded=
+true,this._checkError()?(this._clean(),this._sendComplete()):this.handleError()};a.handleTimeout=function(){this._clean();this._sendError()};a._createXHR=function(a){this._xhrLevel=1;if(window.ArrayBuffer)this._xhrLevel=2;if(window.XMLHttpRequest)this._request=new XMLHttpRequest;else try{this._request=new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(b){return null}a.type==createjs.PreloadJS.TEXT&&this._request.overrideMimeType&&this._request.overrideMimeType("text/plain; charset=x-user-defined");this._request.open("GET",
+a.src,true);if(createjs.PreloadJS.isBinary(a.type))this._request.responseType="arraybuffer";return true};a._clean=function(){clearTimeout(this._loadTimeOutTimeout);var a=this._request;a.onloadstart=null;a.onprogress=null;a.onabort=null;a.onerror=null;a.onload=null;a.ontimeout=null;a.onloadend=null;a.onreadystatechange=null;clearInterval(this._checkLoadInterval)};a.toString=function(){return"[PreloadJS XHRLoader]"};createjs.XHRLoader=d})();
View
36 examples/assets/soundjs-0.3.0.min.js
@@ -0,0 +1,36 @@
+/**
+* SoundJS
+* Visit http://createjs.com/ for documentation, updates and examples.
+*
+* Copyright (c) 2011 gskinner.com, inc.
+*
+* Distributed under the terms of the MIT license.
+* http://www.opensource.org/licenses/mit-license.html
+*
+* This notice shall be included in all copies or substantial portions of the Software.
+**/
+this.createjs=this.createjs||{};
+(function(){function b(){throw"SoundJS cannot be instantiated";}function f(a,b){this.init(a,b)}function d(){}b.DELIMITER="|";b.AUDIO_TIMEOUT=8E3;b.INTERRUPT_ANY="any";b.INTERRUPT_EARLY="early";b.INTERRUPT_LATE="late";b.INTERRUPT_NONE="none";b.PLAY_INITED="playInited";b.PLAY_SUCCEEDED="playSucceeded";b.PLAY_INTERRUPTED="playInterrupted";b.PLAY_FINISHED="playFinished";b.PLAY_FAILED="playFailed";b.activePlugin=null;b.muted=false;b.pluginsRegistered=false;b.masterVolume=1;b.instances=[];b.instanceHash=
+{};b.idHash=null;b.defaultSoundInstance=null;b.getPreloadHandlers=function(){return{callback:b.proxy(b.initLoad,b),types:["sound"],extensions:["mp3","ogg","wav"]}};b.registerPlugins=function(a){b.pluginsRegistered=true;for(var g=0,c=a.length;g<c;g++){var e=a[g];if(e!=null&&e.isSupported())return b.activePlugin=new e,true}return false};b.registerPlugin=function(a){b.pluginsRegistered=true;if(a==null)return false;return a.isSupported()?(b.activePlugin=new a,true):false};b.isReady=function(){return b.activePlugin!=
+null};b.getCapabilities=function(){return b.activePlugin==null?null:b.activePlugin.capabilities};b.getCapability=function(a){return b.activePlugin==null?null:b.activePlugin.capabilities[a]};b.initLoad=function(a,g,c,e){if(!b.checkPlugin(true))return false;a=b.parsePath(a,g,c,e);if(a==null)return false;if(c!=null){if(b.idHash==null)b.idHash={};b.idHash[c]=a.src}f.create(a.src,e);c=b.activePlugin.register(a.src,e);if(c!=null){if(c.tag!=null)a.tag=c.tag;else if(c.src)a.src=c.src;if(c.completeHandler!=
+null)a.handler=c.completeHandler}return a};b.parsePath=function(a,g,c,e){for(var a=a.split(b.DELIMITER),g={type:g||"sound",id:c,data:e,handler:b.handleSoundReady},c=false,e=b.getCapabilities(),h=0,d=a.length;h<d;h++){var f=a[h],i=f.lastIndexOf("."),k=f.substr(i+1).toLowerCase(),i=f.substr(0,i).split("/").pop();switch(k){case "mp3":e.mp3&&(c=true);break;case "ogg":e.ogg&&(c=true);break;case "wav":e.wav&&(c=true)}if(c)return g.name=i,g.src=f,g.extension=k,g}return null};b.play=function(a,g,c,e,h,f,
+d){if(!b.checkPlugin(true))return b.defaultSoundInstance;a=b.getSrcFromId(a);a=b.activePlugin.create(a);try{a.mute(b.muted)}catch(i){}b.playInstance(a,g,c,e,h,f,d)||a.playFailed();return a};b.playInstance=function(a,g,c,e,h,f,d){g=g||b.INTERRUPT_NONE;c==null&&(c=0);e==null&&(e=0);h==null&&(h=0);f==null&&(f=1);d==null&&(d=0);if(c==0){if(!b.beginPlaying(a,g,e,h,f,d))return false}else setTimeout(function(){b.beginPlaying(a,g,e,h,f,d)},c);this.instances.push(a);this.instanceHash[a.uniqueId]=a;return true};
+b.beginPlaying=function(a,b,c,e,d,j){if(!f.add(a,b))return false;return!a.beginPlaying(c,e,d,j)?(this.instances.splice(this.instances.indexOf(a),1),delete this.instanceHash[a.uniqueId],false):true};b.checkPlugin=function(a){return b.activePlugin==null&&(a&&!b.pluginsRegistered&&b.registerPlugin(createjs.HTMLAudioPlugin),b.activePlugin==null)?false:true};b.getSrcFromId=function(a){return b.idHash==null||b.idHash[a]==null?a:b.idHash[a]};b.setVolume=function(a,g){if(Number(a)==null)return false;a=Math.max(0,
+Math.min(1,a));return b.tellAllInstances("setVolume",g,a)};b.getMasterVolume=function(){return b.masterVolume};b.setMasterVolume=function(a){b.masterVolume=a;return b.tellAllInstances("setMasterVolume",null,a)};b.setMute=function(a){this.muted=a;return b.tellAllInstances("mute",null,a)};b.pause=function(a){return b.tellAllInstances("pause",a)};b.resume=function(a){return b.tellAllInstances("resume",a)};b.stop=function(a){return b.tellAllInstances("stop",a)};b.getInstanceById=function(a){return this.instanceHash[a]};
+b.playFinished=function(a){f.remove(a);this.instances.splice(this.instances.indexOf(a),1)};b.tellAllInstances=function(a,b,c){if(this.activePlugin==null)return false;for(var b=this.getSrcFromId(b),e=this.instances.length-1;e>=0;e--){var d=this.instances[e];if(!(b!=null&&d.src!=b))switch(a){case "pause":d.pause();break;case "resume":d.resume();break;case "setVolume":d.setVolume(c);break;case "setMasterVolume":d.setMasterVolume(c);break;case "mute":d.mute(c);break;case "stop":d.stop();break;case "setPan":d.setPan(c)}}return true};
+b.proxy=function(a,b){return function(){return a.apply(b,arguments)}};createjs.SoundJS=b;f.channels={};f.create=function(a,b){var c=f.get(a);c==null?f.channels[a]=new f(a,b):c.max+=b};f.add=function(a,b){var c=f.get(a.src);return c==null?false:c.add(a,b)};f.remove=function(a){var b=f.get(a.src);if(b==null)return false;b.remove(a);return true};f.get=function(a){return f.channels[a]};f.prototype={src:null,max:null,length:0,init:function(a,b){this.src=a;this.max=b||1;this.instances=[]},get:function(a){return this.instances[a]},
+add:function(a,b){if(!this.getSlot(b,a))return false;this.instances.push(a);this.length++;return true},remove:function(a){a=this.instances.indexOf(a);if(a==-1)return false;this.instances.splice(a,1);this.length--;return true},getSlot:function(a){for(var g,c,e=0,d=this.max||100;e<d;e++){g=this.get(e);if(g==null)return true;else if(a==b.INTERRUPT_NONE)continue;if(e==0)c=g;else if(g.playState==b.PLAY_FINISHED||g==b.PLAY_INTERRUPTED||g==b.PLAY_FAILED)c=g;else if(a==b.INTERRUPT_EARLY&&g.getPosition()<
+c.getPosition()||a==b.INTERRUPT_LATE&&g.getPosition()>c.getPosition())c=g}return c!=null?(c.interrupt(),this.remove(c),true):false},toString:function(){return"[SoundJS SoundChannel]"}};b.defaultSoundInstance=new function(){this.isDefault=true;this.pause=this.resume=this.play=this.beginPlaying=this.cleanUp=this.interrupt=this.stop=this.setMasterVolume=this.setVolume=this.mute=this.setPan=this.getPosition=this.setPosition=this.playFailed=function(){return false};this.getVolume=this.getPan=this.getDuration=
+function(){return 0};this.playState=b.PLAY_FAILED;this.toString=function(){return"[SoundJS Default Sound Instance]"}};d.init=function(){var a=navigator.userAgent;d.isFirefox=a.indexOf("Firefox")>-1;d.isOpera=window.opera!=null;d.isIOS=a.indexOf("iPod")>-1||a.indexOf("iPhone")>-1||a.indexOf("iPad")>-1};d.init();createjs.SoundJS.BrowserDetect=d})();this.createjs=this.createjs||{};
+(function(){function b(){this.init()}function f(a){this.init(a)}function d(a){this.init(a)}b.MAX_INSTANCES=30;b.capabilities=null;b.lastId=0;b.AUDIO_READY="canplaythrough";b.AUDIO_ENDED="ended";b.AUDIO_ERROR="error";b.AUDIO_STALLED="stalled";b.fillChannels=false;b.isSupported=function(){if(createjs.SoundJS.BrowserDetect.isIOS)return false;b.generateCapabilities();return b.tag==null?false:true};b.generateCapabilities=function(){if(b.capabilities==null){var a=b.tag=document.createElement("audio");if(a.canPlayType==
+null)return null;b.capabilities={panning:false,volume:true,mp3:a.canPlayType("audio/mp3")!="no"&&a.canPlayType("audio/mp3")!="",ogg:a.canPlayType("audio/ogg")!="no"&&a.canPlayType("audio/ogg")!="",mpeg:a.canPlayType("audio/mpeg")!="no"&&a.canPlayType("audio/mpeg")!="",wav:a.canPlayType("audio/wav")!="no"&&a.canPlayType("audio/wav")!="",channels:b.MAX_INSTANCES}}};b.prototype={capabilities:null,FT:0.0010,channels:null,init:function(){this.capabilities=b.capabilities;this.channels={}},register:function(a,
+b){for(var c=d.get(a),e,f=0,j=b||1;f<j;f++)e=this.createTag(a),c.add(e);return{tag:e}},createTag:function(a){var b=document.createElement("audio");b.preload=false;b.src=a;return b},create:function(a){a=new f(a);a.owner=this;return a},toString:function(){return"[HTMLAudioPlugin]"}};createjs.HTMLAudioPlugin=b;f.prototype={src:null,uniqueId:-1,playState:null,owner:null,loaded:false,lastInterrupt:createjs.SoundJS.INTERRUPT_NONE,offset:0,delay:0,volume:1,pan:0,remainingLoops:0,delayTimeout:-1,tag:null,
+muted:false,paused:false,onComplete:null,onLoop:null,onReady:null,onPlayFailed:null,onPlayInterrupted:null,endedHandler:null,readyHandler:null,stalledHandler:null,init:function(a){this.uniqueId=createjs.HTMLAudioPlugin.lastId++;this.src=a;this.endedHandler=createjs.SoundJS.proxy(this.handleSoundComplete,this);this.readyHandler=createjs.SoundJS.proxy(this.handleSoundReady,this);this.stalledHandler=createjs.SoundJS.proxy(this.handleSoundStalled,this)},cleanUp:function(){var a=this.tag;if(a!=null){a.pause();
+try{a.currentTime=0}catch(b){}a.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_ENDED,this.endedHandler,false);a.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_READY,this.readyHandler,false);d.setInstance(this.src,a);this.tag=null}window.createjs!=null&&createjs.SoundJS.playFinished(this)},interrupt:function(){if(this.tag!=null){this.playState=createjs.SoundJS.PLAY_INTERRUPTED;if(this.onPlayInterrupted)this.onPlayInterrupted(this);this.cleanUp();this.paused=false}},play:function(a,b,c,e,d,
+f){this.cleanUp();createjs.SoundJS.playInstance(this,a,b,c,e,d,f)},beginPlaying:function(a,b,c){if(window.createjs!=null){var e=this.tag=d.getInstance(this.src);if(e==null)return this.playFailed(),-1;e.addEventListener(createjs.HTMLAudioPlugin.AUDIO_ENDED,this.endedHandler,false);this.offset=a;this.volume=c;this.updateVolume();this.remainingLoops=b;e.readyState!==4?(e.addEventListener(createjs.HTMLAudioPlugin.AUDIO_READY,this.readyHandler,false),e.addEventListener(createjs.HTMLAudioPlugin.AUDIO_STALLED,
+this.stalledHandler,false),e.load()):this.handleSoundReady(null);return 1}},handleSoundStalled:function(){if(this.onPlayFailed!=null)this.onPlayFailed(this);this.cleanUp()},handleSoundReady:function(){if(window.createjs!=null)if(this.playState=createjs.SoundJS.PLAY_SUCCEEDED,this.paused=false,this.tag.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_READY,this.readyHandler,false),this.offset>=this.getDuration())this.playFailed();else{if(this.offset>0)this.tag.currentTime=this.offset*0.0010;if(this.remainingLoops==
+-1)this.tag.loop=true;this.tag.play()}},pause:function(){this.paused=true;return this.tag!=null?(this.tag.pause(),false):true},resume:function(){this.paused=false;return this.tag!=null?(this.tag.play(),false):true},stop:function(){this.pause();this.playState=createjs.SoundJS.PLAY_FINISHED;this.cleanUp();return true},setMasterVolume:function(){this.updateVolume();return true},setVolume:function(a){this.volume=a;this.updateVolume();return true},updateVolume:function(){return this.tag!=null?(this.tag.volume=
+this.muted?0:this.volume*createjs.SoundJS.masterVolume,true):false},getVolume:function(){return this.volume},mute:function(a){this.muted=a;this.updateVolume();return true},setPan:function(){return false},getPan:function(){return 0},getPosition:function(){return this.tag==null?0:this.tag.currentTime*1E3},setPosition:function(a){if(this.tag==null)return false;try{this.tag.currentTime=a*0.0010}catch(b){return false}return true},getDuration:function(){return this.tag==null?0:this.tag.duration*1E3},handleSoundComplete:function(){if(this.remainingLoops!=
+0){if(this.remainingLoops--,this.tag.play(),this.onLoop!=null)this.onLoop(this)}else if(window.createjs!=null){this.playState=createjs.SoundJS.PLAY_FINISHED;if(this.onComplete!=null)this.onComplete(this);this.cleanUp()}},playFailed:function(){if(window.createjs!=null){this.playState=createjs.SoundJS.PLAY_FAILED;if(this.onPlayFailed!=null)this.onPlayFailed(this);this.cleanUp()}},toString:function(){return"[HTMLAudioPlugin SoundInstance]"}};d.channels={};d.get=function(a){var b=d.channels[a];b==null&&
+(b=d.channels[a]=new d(a));return b};d.getInstance=function(a){a=d.channels[a];return a==null?null:a.get()};d.setInstance=function(a,b){var c=d.channels[a];return c==null?null:c.set(b)};d.prototype={src:null,length:0,available:0,tags:null,init:function(a){this.src=a;this.tags=[]},add:function(a){this.tags.push(a);this.length++;this.available=this.tags.length},get:function(){if(this.tags.length==0)return null;this.available=this.tags.length;var a=this.tags.pop();document.body.appendChild(a);return a},
+set:function(a){this.tags.indexOf(a)==-1&&this.tags.push(a);document.body.removeChild(a);this.available=this.tags.length},toString:function(){return"[HTMLAudioPlugin TagChannel]"}}})();
View
0 examples/assets/tweenjs-0.2.0.min.js → examples/assets/tweenjs-0.3.0.min.js
File renamed without changes.
View
89 lib/easeljs-0.4.2.min.js
@@ -1,89 +0,0 @@
-/*
-* EaselJS
-* Visit http://createjs.com/ for documentation, updates and examples.
-*
-* Copyright (c) 2011 gskinner.com, inc.
-*
-* Distributed under the terms of the MIT license.
-* http://www.opensource.org/licenses/mit-license.html
-*
-* This notice shall be included in all copies or substantial portions of the Software.
-*/
-(function(j){var c=function(){throw"UID cannot be instantiated";};c._nextID=0;c.get=function(){return c._nextID++};j.UID=c})(window);(function(j){var c=function(){throw"Ticker cannot be instantiated.";};c.useRAF=null;c.animationTarget=null;c._listeners=null;c._pauseable=null;c._paused=false;c._inited=false;c._startTime=0;c._pausedTime=0;c._ticks=0;c._pausedTickers=0;c._interval=50;c._lastTime=0;c._times=null;c._tickTimes=null;c._rafActive=false;c._timeoutID=null;c.addListener=function(a,b){a!=null&&(c._inited||c.init(),c.removeListener(a),c._pauseable[c._listeners.length]=b==null?true:b,c._listeners.push(a))};c.init=function(){c._inited=
-true;c._times=[];c._tickTimes=[];c._pauseable=[];c._listeners=[];c._times.push(c._lastTime=c._startTime=c._getTime());c.setInterval(c._interval)};c.removeListener=function(a){c._listeners!=null&&(a=c._listeners.indexOf(a),a!=-1&&(c._listeners.splice(a,1),c._pauseable.splice(a,1)))};c.removeAllListeners=function(){c._listeners=[];c._pauseable=[]};c.setInterval=function(a){c._interval=a;c._inited&&c._setupTick()};c.getInterval=function(){return c._interval};c.setFPS=function(a){c.setInterval(1E3/a)};
-c.getFPS=function(){return 1E3/c._interval};c.getMeasuredFPS=function(a){if(c._times.length<2)return-1;a==null&&(a=c.getFPS()|0);a=Math.min(c._times.length-1,a);return 1E3/((c._times[0]-c._times[a])/a)};c.setPaused=function(a){c._paused=a};c.getPaused=function(){return c._paused};c.getTime=function(a){return c._getTime()-c._startTime-(a?c._pausedTime:0)};c.getTicks=function(a){return c._ticks-(a?c._pausedTickers:0)};c._handleAF=function(a){c._rafActive=false;c._setupTick();a-c._lastTime>=c._interval-
-1&&c._tick()};c._handleTimeout=function(){c.timeoutID=null;c._setupTick();c._tick()};c._setupTick=function(){if(!(c._rafActive||c.timeoutID!=null)){if(c.useRAF){var a=j.requestAnimationFrame||j.webkitRequestAnimationFrame||j.mozRequestAnimationFrame||j.oRequestAnimationFrame||j.msRequestAnimationFrame;if(a){a(c._handleAF,c.animationTarget);c._rafActive=true;return}}c.timeoutID=setTimeout(c._handleTimeout,c._interval)}};c._tick=function(){c._ticks++;var a=c._getTime(),b=a-c._lastTime,p=c._paused;p&&
-(c._pausedTickers++,c._pausedTime+=b);c._lastTime=a;for(var h=c._pauseable,e=c._listeners.slice(),d=e?e.length:0,f=0;f<d;f++){var g=e[f];g==null||p&&h[f]||(g.tick?g.tick(b,p):g instanceof Function&&g(b,p))}for(c._tickTimes.unshift(c._getTime()-a);c._tickTimes.length>100;)c._tickTimes.pop();for(c._times.unshift(a);c._times.length>100;)c._times.pop()};c._getTime=function(){return(new Date).getTime()};j.Ticker=c})(window);(function(j){var c=function(b,a,h,c,d){this.initialize(b,a,h,c,d)},a=c.prototype;a.stageX=0;a.stageY=0;a.type=null;a.nativeEvent=null;a.onMouseMove=null;a.onMouseUp=null;a.target=null;a.initialize=function(b,a,h,c,d){this.type=b;this.stageX=a;this.stageY=h;this.target=c;this.nativeEvent=d};a.clone=function(){return new c(this.type,this.stageX,this.stageY,this.target,this.nativeEvent)};a.toString=function(){return"[MouseEvent (type="+this.type+" stageX="+this.stageX+" stageY="+this.stageY+")]"};j.MouseEvent=
-c})(window);(function(j){var c=function(b,a,h,c,d,f){this.initialize(b,a,h,c,d,f)},a=c.prototype;c.identity=null;c.DEG_TO_RAD=Math.PI/180;a.a=1;a.b=0;a.c=0;a.d=1;a.tx=0;a.ty=0;a.alpha=1;a.shadow=null;a.compositeOperation=null;a.initialize=function(b,a,h,c,d,f){if(b!=null)this.a=b;this.b=a||0;this.c=h||0;if(c!=null)this.d=c;this.tx=d||0;this.ty=f||0};a.prepend=function(b,a,h,c,d,f){var g=this.tx;if(b!=1||a!=0||h!=0||c!=1){var k=this.a,i=this.c;this.a=k*b+this.b*h;this.b=k*a+this.b*c;this.c=i*b+this.d*h;this.d=
-i*a+this.d*c}this.tx=g*b+this.ty*h+d;this.ty=g*a+this.ty*c+f};a.append=function(b,a,h,c,d,f){var g=this.a,k=this.b,i=this.c,l=this.d;this.a=b*g+a*i;this.b=b*k+a*l;this.c=h*g+c*i;this.d=h*k+c*l;this.tx=d*g+f*i+this.tx;this.ty=d*k+f*l+this.ty};a.prependMatrix=function(b){this.prepend(b.a,b.b,b.c,b.d,b.tx,b.ty);this.prependProperties(b.alpha,b.shadow,b.compositeOperation)};a.appendMatrix=function(b){this.append(b.a,b.b,b.c,b.d,b.tx,b.ty);this.appendProperties(b.alpha,b.shadow,b.compositeOperation)};
-a.prependTransform=function(b,a,h,e,d,f,g,k,i){if(d%360)var l=d*c.DEG_TO_RAD,d=Math.cos(l),l=Math.sin(l);else d=1,l=0;if(k||i)this.tx-=k,this.ty-=i;f||g?(f*=c.DEG_TO_RAD,g*=c.DEG_TO_RAD,this.prepend(d*h,l*h,-l*e,d*e,0,0),this.prepend(Math.cos(g),Math.sin(g),-Math.sin(f),Math.cos(f),b,a)):this.prepend(d*h,l*h,-l*e,d*e,b,a)};a.appendTransform=function(b,a,h,e,d,f,g,k,i){if(d%360)var l=d*c.DEG_TO_RAD,d=Math.cos(l),l=Math.sin(l);else d=1,l=0;f||g?(f*=c.DEG_TO_RAD,g*=c.DEG_TO_RAD,this.append(Math.cos(g),
-Math.sin(g),-Math.sin(f),Math.cos(f),b,a),this.append(d*h,l*h,-l*e,d*e,0,0)):this.append(d*h,l*h,-l*e,d*e,b,a);if(k||i)this.tx-=k*this.a+i*this.c,this.ty-=k*this.b+i*this.d};a.rotate=function(b){var a=Math.cos(b),b=Math.sin(b),h=this.a,c=this.c,d=this.tx;this.a=h*a-this.b*b;this.b=h*b+this.b*a;this.c=c*a-this.d*b;this.d=c*b+this.d*a;this.tx=d*a-this.ty*b;this.ty=d*b+this.ty*a};a.skew=function(b,a){b*=c.DEG_TO_RAD;a*=c.DEG_TO_RAD;this.append(Math.cos(a),Math.sin(a),-Math.sin(b),Math.cos(b),0,0)};a.scale=
-function(b,a){this.a*=b;this.d*=a;this.tx*=b;this.ty*=a};a.translate=function(b,a){this.tx+=b;this.ty+=a};a.identity=function(){this.alpha=this.a=this.d=1;this.b=this.c=this.tx=this.ty=0;this.shadow=this.compositeOperation=null};a.invert=function(){var b=this.a,a=this.b,h=this.c,c=this.d,d=this.tx,f=b*c-a*h;this.a=c/f;this.b=-a/f;this.c=-h/f;this.d=b/f;this.tx=(h*this.ty-c*d)/f;this.ty=-(b*this.ty-a*d)/f};a.isIdentity=function(){return this.tx==0&&this.ty==0&&this.a==1&&this.b==0&&this.c==0&&this.d==
-1};a.decompose=function(b){b==null&&(b={});b.x=this.tx;b.y=this.ty;b.scaleX=Math.sqrt(this.a*this.a+this.b*this.b);b.scaleY=Math.sqrt(this.c*this.c+this.d*this.d);var a=Math.atan2(-this.c,this.d),h=Math.atan2(this.b,this.a);a==h?(b.rotation=h/c.DEG_TO_RAD,this.a<0&&this.d>=0&&(b.rotation+=b.rotation<=0?180:-180),b.skewX=b.skewY=0):(b.skewX=a/c.DEG_TO_RAD,b.skewY=h/c.DEG_TO_RAD);return b};a.reinitialize=function(b,a,h,c,d,f,g,k,i){this.initialize(b,a,h,c,d,f);this.alpha=g||1;this.shadow=k;this.compositeOperation=
-i;return this};a.appendProperties=function(b,a,h){this.alpha*=b;this.shadow=a||this.shadow;this.compositeOperation=h||this.compositeOperation};a.prependProperties=function(b,a,h){this.alpha*=b;this.shadow=this.shadow||a;this.compositeOperation=this.compositeOperation||h};a.clone=function(){var b=new c(this.a,this.b,this.c,this.d,this.tx,this.ty);b.shadow=this.shadow;b.alpha=this.alpha;b.compositeOperation=this.compositeOperation;return b};a.toString=function(){return"[Matrix2D (a="+this.a+" b="+this.b+
-" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+")]"};c.identity=new c(1,0,0,1,0,0);j.Matrix2D=c})(window);(function(j){var c=function(b,a){this.initialize(b,a)},a=c.prototype;a.x=0;a.y=0;a.initialize=function(b,a){this.x=b==null?0:b;this.y=a==null?0:a};a.clone=function(){return new c(this.x,this.y)};a.toString=function(){return"[Point (x="+this.x+" y="+this.y+")]"};j.Point=c})(window);(function(j){var c=function(b,a,h,c){this.initialize(b,a,h,c)},a=c.prototype;a.x=0;a.y=0;a.width=0;a.height=0;a.initialize=function(b,a,c,e){this.x=b==null?0:b;this.y=a==null?0:a;this.width=c==null?0:c;this.height=e==null?0:e};a.clone=function(){return new c(this.x,this.y,this.width,this.height)};a.toString=function(){return"[Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")]"};j.Rectangle=c})(window);(function(j){var c=function(b,a,c,e){this.initialize(b,a,c,e)},a=c.prototype;c.identity=null;a.color=null;a.offsetX=0;a.offsetY=0;a.blur=0;a.initialize=function(b,a,c,e){this.color=b;this.offsetX=a;this.offsetY=c;this.blur=e};a.toString=function(){return"[Shadow]"};a.clone=function(){return new c(this.color,this.offsetX,this.offsetY,this.blur)};c.identity=new c("transparent",0,0,0);j.Shadow=c})(window);(function(j){var c=function(b){this.initialize(b)},a=c.prototype;a.complete=true;a.onComplete=null;a._animations=null;a._frames=null;a._images=null;a._data=null;a._loadCount=0;a._frameHeight=0;a._frameWidth=0;a._numFrames=0;a._regX=0;a._regY=0;a.initialize=function(b){var a,c,e;if(b!=null){if(b.images&&(c=b.images.length)>0){e=this._images=[];for(a=0;a<c;a++){var d=b.images[a];if(!(d instanceof Image)){var f=d,d=new Image;d.src=f}e.push(d);if(!d.getContext&&!d.complete)this._loadCount++,this.complete=
-false,function(b){d.onload=function(){b._handleImageLoad()}}(this)}}if(b.frames!=null)if(b.frames instanceof Array){this._frames=[];e=b.frames;for(a=0,c=e.length;a<c;a++)f=e[a],this._frames.push({image:this._images[f[4]?f[4]:0],rect:new Rectangle(f[0],f[1],f[2],f[3]),regX:f[5]||0,regY:f[6]||0})}else c=b.frames,this._frameWidth=c.width,this._frameHeight=c.height,this._regX=c.regX||0,this._regY=c.regY||0,this._numFrames=c.count,this._loadCount==0&&this._calculateFrames();if((c=b.animations)!=null){this._animations=
-[];this._data={};for(var g in c){b={name:g};f=c[g];if(isNaN(f))if(f instanceof Array){b.frequency=f[3];b.next=f[2];e=b.frames=[];for(a=f[0];a<=f[1];a++)e.push(a)}else b.frequency=f.frequency,b.next=f.next,e=b.frames=f.frames.slice(0);else e=b.frames=[f];b.next=e.length<2||b.next==false?null:b.next==null||b.next==true?g:b.next;if(!b.frequency)b.frequency=1;this._animations.push(g);this._data[g]=b}}}};a.getNumFrames=function(b){return b==null?this._frames?this._frames.length:this._numFrames:(b=this._data[b],
-b==null?0:b.frames.length)};a.getAnimations=function(){return this._animations.slice(0)};a.getAnimation=function(b){return this._data[b]};a.getFrame=function(b){return this.complete&&this._frames&&(frame=this._frames[b])?frame:null};a.toString=function(){return"[SpriteSheet]"};a.clone=function(){var b=new c;b.complete=this.complete;b._animations=this._animations;b._frames=this._frames;b._images=this._images;b._data=this._data;b._frameHeight=this._frameHeight;b._frameWidth=this._frameWidth;b._numFrames=
-this._numFrames;b._loadCount=this._loadCount;return b};a._handleImageLoad=function(){if(--this._loadCount==0)this._calculateFrames(),this.complete=true,this.onComplete&&this.onComplete()};a._calculateFrames=function(){if(!(this._frames||this._frameWidth==0)){this._frames=[];for(var b=0,a=this._frameWidth,c=this._frameHeight,e=0,d=this._images;e<d.length;e++){for(var f=d[e],g=(f.width+1)/a|0,k=(f.height+1)/c|0,k=this._numFrames>0?Math.min(this._numFrames-b,g*k):g*k,i=0;i<k;i++)this._frames.push({image:f,
-rect:new Rectangle(i%g*a,(i/g|0)*c,a,c),regX:this._regX,regY:this._regY});b+=k}this._numFrames=b}};j.SpriteSheet=c})(window);(function(j){function c(b,a){this.f=b;this.params=a}c.prototype.exec=function(b){this.f.apply(b,this.params)};var a=function(){this.initialize()},b=a.prototype;a.getRGB=function(b,a,c,d){b!=null&&c==null&&(d=a,c=b&255,a=b>>8&255,b=b>>16&255);return d==null?"rgb("+b+","+a+","+c+")":"rgba("+b+","+a+","+c+","+d+")"};a.getHSL=function(b,a,c,d){return d==null?"hsl("+b%360+","+a+"%,"+c+"%)":"hsla("+b%360+","+a+"%,"+c+"%,"+d+")"};a.BASE_64={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,
-P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,a:26,b:27,c:28,d:29,e:30,f:31,g:32,h:33,i:34,j:35,k:36,l:37,m:38,n:39,o:40,p:41,q:42,r:43,s:44,t:45,u:46,v:47,w:48,x:49,y:50,z:51,0:52,1:53,2:54,3:55,4:56,5:57,6:58,7:59,8:60,9:61,"+":62,"/":63};a.STROKE_CAPS_MAP=["butt","round","square"];a.STROKE_JOINTS_MAP=["miter","round","bevel"];a._ctx=document.createElement("canvas").getContext("2d");a.beginCmd=new c(a._ctx.beginPath,[]);a.fillCmd=new c(a._ctx.fill,[]);a.strokeCmd=new c(a._ctx.stroke,[]);
-b._strokeInstructions=null;b._strokeStyleInstructions=null;b._fillInstructions=null;b._instructions=null;b._oldInstructions=null;b._activeInstructions=null;b._active=false;b._dirty=false;b.initialize=function(){this.clear();this._ctx=a._ctx};b.draw=function(b){this._dirty&&this._updateInstructions();for(var a=this._instructions,c=0,d=a.length;c<d;c++)a[c].exec(b)};b.moveTo=function(b,a){this._activeInstructions.push(new c(this._ctx.moveTo,[b,a]));return this};b.lineTo=function(b,a){this._dirty=this._active=
-true;this._activeInstructions.push(new c(this._ctx.lineTo,[b,a]));return this};b.arcTo=function(b,a,e,d,f){this._dirty=this._active=true;this._activeInstructions.push(new c(this._ctx.arcTo,[b,a,e,d,f]));return this};b.arc=function(b,a,e,d,f,g){this._dirty=this._active=true;g==null&&(g=false);this._activeInstructions.push(new c(this._ctx.arc,[b,a,e,d,f,g]));return this};b.quadraticCurveTo=function(b,a,e,d){this._dirty=this._active=true;this._activeInstructions.push(new c(this._ctx.quadraticCurveTo,
-[b,a,e,d]));return this};b.bezierCurveTo=function(b,a,e,d,f,g){this._dirty=this._active=true;this._activeInstructions.push(new c(this._ctx.bezierCurveTo,[b,a,e,d,f,g]));return this};b.rect=function(b,a,e,d){this._dirty=this._active=true;this._activeInstructions.push(new c(this._ctx.rect,[b,a,e,d]));return this};b.closePath=function(){if(this._active)this._dirty=true,this._activeInstructions.push(new c(this._ctx.closePath,[]));return this};b.clear=function(){this._instructions=[];this._oldInstructions=
-[];this._activeInstructions=[];this._strokeStyleInstructions=this._strokeInstructions=this._fillInstructions=null;this._active=this._dirty=false;return this};b.beginFill=function(b){this._active&&this._newPath();this._fillInstructions=b?[new c(this._setProp,["fillStyle",b])]:null;return this};b.beginLinearGradientFill=function(b,a,e,d,f,g){this._active&&this._newPath();e=this._ctx.createLinearGradient(e,d,f,g);d=0;for(f=b.length;d<f;d++)e.addColorStop(a[d],b[d]);this._fillInstructions=[new c(this._setProp,
-["fillStyle",e])];return this};b.beginRadialGradientFill=function(b,a,e,d,f,g,k,i){this._active&&this._newPath();e=this._ctx.createRadialGradient(e,d,f,g,k,i);d=0;for(f=b.length;d<f;d++)e.addColorStop(a[d],b[d]);this._fillInstructions=[new c(this._setProp,["fillStyle",e])];return this};b.beginBitmapFill=function(b,a){this._active&&this._newPath();var e=this._ctx.createPattern(b,a||"");this._fillInstructions=[new c(this._setProp,["fillStyle",e])];return this};b.endFill=function(){this.beginFill();
-return this};b.setStrokeStyle=function(b,h,e,d){this._active&&this._newPath();this._strokeStyleInstructions=[new c(this._setProp,["lineWidth",b==null?"1":b]),new c(this._setProp,["lineCap",h==null?"butt":isNaN(h)?h:a.STROKE_CAPS_MAP[h]]),new c(this._setProp,["lineJoin",e==null?"miter":isNaN(e)?e:a.STROKE_JOINTS_MAP[e]]),new c(this._setProp,["miterLimit",d==null?"10":d])];return this};b.beginStroke=function(b){this._active&&this._newPath();this._strokeInstructions=b?[new c(this._setProp,["strokeStyle",
-b])]:null;return this};b.beginLinearGradientStroke=function(b,a,e,d,f,g){this._active&&this._newPath();e=this._ctx.createLinearGradient(e,d,f,g);d=0;for(f=b.length;d<f;d++)e.addColorStop(a[d],b[d]);this._strokeInstructions=[new c(this._setProp,["strokeStyle",e])];return this};b.beginRadialGradientStroke=function(b,a,e,d,f,g,k,i){this._active&&this._newPath();e=this._ctx.createRadialGradient(e,d,f,g,k,i);d=0;for(f=b.length;d<f;d++)e.addColorStop(a[d],b[d]);this._strokeInstructions=[new c(this._setProp,
-["strokeStyle",e])];return this};b.beginBitmapStroke=function(b,a){this._active&&this._newPath();var e=this._ctx.createPattern(b,a||"");this._strokeInstructions=[new c(this._setProp,["strokeStyle",e])];return this};b.endStroke=function(){this.beginStroke();return this};b.curveTo=b.quadraticCurveTo;b.drawRect=b.rect;b.drawRoundRect=function(b,a,c,d,f){this.drawRoundRectComplex(b,a,c,d,f,f,f,f);return this};b.drawRoundRectComplex=function(b,a,e,d,f,g,k,i){this._dirty=this._active=true;var l=Math.PI,
-j=this._ctx.arc,m=this._ctx.lineTo;this._activeInstructions.push(new c(this._ctx.moveTo,[b+f,a]),new c(m,[b+e-g,a]),g>=0?new c(j,[b+e-g,a+g,g,-l/2,0]):new c(j,[b+e,a,-g,l,l/2,true]),new c(m,[b+e,a+d-k]),i>=0?new c(j,[b+e-k,a+d-k,k,0,l/2]):new c(j,[b+e,a+d,-k,-l/2,l,true]),new c(m,[b+i,a+d]),i>=0?new c(j,[b+i,a+d-i,i,l/2,l]):new c(j,[b,a+d,-i,0,-l/2,true]),new c(m,[b,a+f]),f>=0?new c(j,[b+f,a+f,f,l,-l/2]):new c(j,[b,a,-f,l/2,0,true]));return this};b.drawCircle=function(b,a,c){this.arc(b,a,c,0,Math.PI*
-2);return this};b.drawEllipse=function(b,a,e,d){this._dirty=this._active=true;var f=e/2*0.5522848,g=d/2*0.5522848,k=b+e,i=a+d,e=b+e/2,d=a+d/2;this._activeInstructions.push(new c(this._ctx.moveTo,[b,d]),new c(this._ctx.bezierCurveTo,[b,d-g,e-f,a,e,a]),new c(this._ctx.bezierCurveTo,[e+f,a,k,d-g,k,d]),new c(this._ctx.bezierCurveTo,[k,d+g,e+f,i,e,i]),new c(this._ctx.bezierCurveTo,[e-f,i,b,d+g,b,d]));return this};b.drawPolyStar=function(b,a,e,d,f,g){this._dirty=this._active=true;f==null&&(f=0);f=1-f;g==
-null?g=0:g/=180/Math.PI;var k=Math.PI/d;this._activeInstructions.push(new c(this._ctx.moveTo,[b+Math.cos(g)*e,a+Math.sin(g)*e]));for(var i=0;i<d;i++)g+=k,f!=1&&this._activeInstructions.push(new c(this._ctx.lineTo,[b+Math.cos(g)*e*f,a+Math.sin(g)*e*f])),g+=k,this._activeInstructions.push(new c(this._ctx.lineTo,[b+Math.cos(g)*e,a+Math.sin(g)*e]));return this};b.p=b.decodePath=function(b){for(var c=[this.moveTo,this.lineTo,this.quadraticCurveTo,this.bezierCurveTo],e=[2,2,4,6],d=0,f=b.length,g=[],k=0,
-i=0,l=a.BASE_64;d<f;){var j=l[b.charAt(d)],m=j>>3,q=c[m];if(!q||j&3)throw"bad path data";var r=e[m];m||(k=i=0);g.length=0;d++;j=(j>>2&1)+2;for(m=0;m<r;m++){var n=l[b.charAt(d)],s=n>>5?-1:1,n=(n&31)<<6|l[b.charAt(d+1)];j==3&&(n=n<<6|l[b.charAt(d+2)]);n=s*n/10;m%2?k=n+=k:i=n+=i;g[m]=n;d+=j}q.apply(this,g)}return this};b.clone=function(){var b=new a;b._instructions=this._instructions.slice();b._activeInstructions=this._activeInstructions.slice();b._oldInstructions=this._oldInstructions.slice();if(this._fillInstructions)b._fillInstructions=
-this._fillInstructions.slice();if(this._strokeInstructions)b._strokeInstructions=this._strokeInstructions.slice();if(this._strokeStyleInstructions)b._strokeStyleInstructions=this._strokeStyleInstructions.slice();b._active=this._active;b._dirty=this._dirty;return b};b.toString=function(){return"[Graphics]"};b.mt=b.moveTo;b.lt=b.lineTo;b.at=b.arcTo;b.bt=b.bezierCurveTo;b.qt=b.quadraticCurveTo;b.a=b.arc;b.r=b.rect;b.cp=b.closePath;b.c=b.clear;b.f=b.beginFill;b.lf=b.beginLinearGradientFill;b.rf=b.beginRadialGradientFill;
-b.bf=b.beginBitmapFill;b.ef=b.endFill;b.ss=b.setStrokeStyle;b.s=b.beginStroke;b.ls=b.beginLinearGradientStroke;b.rs=b.beginRadialGradientStroke;b.bs=b.beginBitmapStroke;b.es=b.endStroke;b.dr=b.drawRect;b.rr=b.drawRoundRect;b.rc=b.drawRoundRectComplex;b.dc=b.drawCircle;b.de=b.drawEllipse;b.dp=b.drawPolyStar;b._updateInstructions=function(){this._instructions=this._oldInstructions.slice();this._instructions.push(a.beginCmd);this._fillInstructions&&this._instructions.push.apply(this._instructions,this._fillInstructions);
-this._strokeInstructions&&(this._instructions.push.apply(this._instructions,this._strokeInstructions),this._strokeStyleInstructions&&this._instructions.push.apply(this._instructions,this._strokeStyleInstructions));this._instructions.push.apply(this._instructions,this._activeInstructions);this._fillInstructions&&this._instructions.push(a.fillCmd);this._strokeInstructions&&this._instructions.push(a.strokeCmd)};b._newPath=function(){this._dirty&&this._updateInstructions();this._oldInstructions=this._instructions;
-this._activeInstructions=[];this._active=this._dirty=false};b._setProp=function(b,a){this[b]=a};j.Graphics=a})(window);(function(j){var c=function(){this.initialize()},a=c.prototype;c.suppressCrossDomainErrors=false;c._hitTestCanvas=document.createElement("canvas");c._hitTestCanvas.width=c._hitTestCanvas.height=1;c._hitTestContext=c._hitTestCanvas.getContext("2d");c._nextCacheID=1;a.alpha=1;a.cacheCanvas=null;a.id=-1;a.mouseEnabled=true;a.name=null;a.parent=null;a.regX=0;a.regY=0;a.rotation=0;a.scaleX=1;a.scaleY=1;a.skewX=0;a.skewY=0;a.shadow=null;a.visible=true;a.x=0;a.y=0;a.compositeOperation=null;a.snapToPixel=
-false;a.onPress=null;a.onClick=null;a.onDoubleClick=null;a.onMouseOver=null;a.onMouseOut=null;a.onTick=null;a.filters=null;a.cacheID=0;a._cacheOffsetX=0;a._cacheOffsetY=0;a._cacheDataURLID=0;a._cacheDataURL=null;a._matrix=null;a.initialize=function(){this.id=UID.get();this._matrix=new Matrix2D};a.isVisible=function(){return this.visible&&this.alpha>0&&this.scaleX!=0&&this.scaleY!=0};a.draw=function(b,a){if(a||!this.cacheCanvas)return false;b.drawImage(this.cacheCanvas,this._cacheOffsetX,this._cacheOffsetY);
-return true};a.cache=function(b,a,h,e){var d=this.cacheCanvas;if(d==null)d=this.cacheCanvas=document.createElement("canvas");var f=d.getContext("2d");d.width=h;d.height=e;f.setTransform(1,0,0,1,-b,-a);f.clearRect(b,a,d.width,d.height);this.draw(f,true,this._matrix.reinitialize(1,0,0,1,-b,-a));this._cacheOffsetX=b;this._cacheOffsetY=a;this._applyFilters();this.cacheID=c._nextCacheID++};a.updateCache=function(b){var a=this.cacheCanvas,h=this._cacheOffsetX,e=this._cacheOffsetY;if(a==null)throw"cache() must be called before updateCache()";
-var d=a.getContext("2d");d.setTransform(1,0,0,1,-h,-e);b?d.globalCompositeOperation=b:d.clearRect(h,e,a.width,a.height);this.draw(d,true);if(b)d.globalCompositeOperation="source-over";this._applyFilters();this.cacheID=c._nextCacheID++};a.uncache=function(){this._cacheDataURL=this.cacheCanvas=null;this.cacheID=this._cacheOffsetX=this._cacheOffsetY=0};a.getCacheDataURL=function(){if(!this.cacheCanvas)return null;if(this.cacheID!=this._cacheDataURLID)this._cacheDataURL=this.cacheCanvas.toDataURL();return this._cacheDataURL};
-a.getStage=function(){for(var b=this;b.parent;)b=b.parent;return b instanceof Stage?b:null};a.localToGlobal=function(b,a){var c=this.getConcatenatedMatrix(this._matrix);if(c==null)return null;c.append(1,0,0,1,b,a);return new Point(c.tx,c.ty)};a.globalToLocal=function(b,a){var c=this.getConcatenatedMatrix(this._matrix);if(c==null)return null;c.invert();c.append(1,0,0,1,b,a);return new Point(c.tx,c.ty)};a.localToLocal=function(b,a,c){b=this.localToGlobal(b,a);return c.globalToLocal(b.x,b.y)};a.setTransform=
-function(b,a,c,e,d,f,g,k,i){this.x=b||0;this.y=a||0;this.scaleX=c==null?1:c;this.scaleY=e==null?1:e;this.rotation=d||0;this.skewX=f||0;this.skewY=g||0;this.regX=k||0;this.regY=i||0};a.getConcatenatedMatrix=function(b){b?b.identity():b=new Matrix2D;for(var a=this;a!=null;)b.prependTransform(a.x,a.y,a.scaleX,a.scaleY,a.rotation,a.skewX,a.skewY,a.regX,a.regY),b.prependProperties(a.alpha,a.shadow,a.compositeOperation),a=a.parent;return b};a.hitTest=function(b,a){var h=c._hitTestContext,e=c._hitTestCanvas;
-h.setTransform(1,0,0,1,-b,-a);this.draw(h);h=this._testHit(h);e.width=0;e.width=1;return h};a.clone=function(){var b=new c;this.cloneProps(b);return b};a.toString=function(){return"[DisplayObject (name="+this.name+")]"};a.cloneProps=function(b){b.alpha=this.alpha;b.name=this.name;b.regX=this.regX;b.regY=this.regY;b.rotation=this.rotation;b.scaleX=this.scaleX;b.scaleY=this.scaleY;b.shadow=this.shadow;b.skewX=this.skewX;b.skewY=this.skewY;b.visible=this.visible;b.x=this.x;b.y=this.y;b.mouseEnabled=
-this.mouseEnabled;b.compositeOperation=this.compositeOperation;if(this.cacheCanvas)b.cacheCanvas=this.cacheCanvas.cloneNode(true),b.cacheCanvas.getContext("2d").putImageData(this.cacheCanvas.getContext("2d").getImageData(0,0,this.cacheCanvas.width,this.cacheCanvas.height),0,0)};a.applyShadow=function(b,a){a=a||Shadow.identity;b.shadowColor=a.color;b.shadowOffsetX=a.offsetX;b.shadowOffsetY=a.offsetY;b.shadowBlur=a.blur};a._tick=function(b){if(this.onTick)this.onTick(b)};a._testHit=function(b){try{var a=
-b.getImageData(0,0,1,1).data[3]>1}catch(h){if(!c.suppressCrossDomainErrors)throw"An error has occured. This is most likely due to security restrictions on reading canvas pixel data with local or cross-domain images.";}return a};a._applyFilters=function(){if(this.filters&&this.filters.length!=0&&this.cacheCanvas)for(var b=this.filters.length,a=this.cacheCanvas.getContext("2d"),c=this.cacheCanvas.width,e=this.cacheCanvas.height,d=0;d<b;d++)this.filters[d].applyFilter(a,0,0,c,e)};j.DisplayObject=c})(window);(function(j){var c=function(){this.initialize()},a=c.prototype=new DisplayObject;a.children=null;a.DisplayObject_initialize=a.initialize;a.initialize=function(){this.DisplayObject_initialize();this.children=[]};a.isVisible=function(){return this.visible&&this.alpha>0&&this.children.length&&this.scaleX!=0&&this.scaleY!=0};a.DisplayObject_draw=a.draw;a.draw=function(b,a,h){var e=Stage._snapToPixelEnabled;if(this.DisplayObject_draw(b,a))return true;for(var h=h||this._matrix.reinitialize(1,0,0,1,0,0,
-this.alpha,this.shadow,this.compositeOperation),a=this.children.length,d=this.children.slice(0),f=0;f<a;f++){var g=d[f];if(g.isVisible()){var k=false,i=g._matrix.reinitialize(h.a,h.b,h.c,h.d,h.tx,h.ty,h.alpha,h.shadow,h.compositeOperation);i.appendTransform(g.x,g.y,g.scaleX,g.scaleY,g.rotation,g.skewX,g.skewY,g.regX,g.regY);i.appendProperties(g.alpha,g.shadow,g.compositeOperation);if(!(g instanceof c&&g.cacheCanvas==null))e&&g.snapToPixel&&i.a==1&&i.b==0&&i.c==0&&i.d==1?b.setTransform(i.a,i.b,i.c,
-i.d,i.tx+0.5|0,i.ty+0.5|0):b.setTransform(i.a,i.b,i.c,i.d,i.tx,i.ty),b.globalAlpha=i.alpha,b.globalCompositeOperation=i.compositeOperation||"source-over",(k=i.shadow)&&this.applyShadow(b,k);g.draw(b,false,i);k&&this.applyShadow(b)}}return true};a.addChild=function(b){if(b==null)return b;var a=arguments.length;if(a>1){for(var c=0;c<a;c++)this.addChild(arguments[c]);return arguments[a-1]}b.parent&&b.parent.removeChild(b);b.parent=this;this.children.push(b);return b};a.addChildAt=function(b,a){var c=
-arguments.length;if(c>2){for(var a=arguments[e-1],e=0;e<c-1;e++)this.addChildAt(arguments[e],a+e);return arguments[c-2]}b.parent&&b.parent.removeChild(b);b.parent=this;this.children.splice(a,0,b);return b};a.removeChild=function(b){var a=arguments.length;if(a>1){for(var c=true,e=0;e<a;e++)c=c&&this.removeChild(arguments[e]);return c}return this.removeChildAt(this.children.indexOf(b))};a.removeChildAt=function(b){var a=arguments.length;if(a>1){for(var c=[],e=0;e<a;e++)c[e]=arguments[e];c.sort(function(b,
-a){return a-b});for(var d=true,e=0;e<a;e++)d=d&&this.removeChildAt(c[e]);return d}if(b<0||b>this.children.length-1)return false;a=this.children[b];if(a!=null)a.parent=null;this.children.splice(b,1);return true};a.removeAllChildren=function(){for(var b=this.children;b.length;)b.pop().parent=null};a.getChildAt=function(b){return this.children[b]};a.sortChildren=function(b){this.children.sort(b)};a.getChildIndex=function(b){return this.children.indexOf(b)};a.getNumChildren=function(){return this.children.length};
-a.swapChildrenAt=function(b,a){var c=this.children,e=c[b],d=c[a];e&&d&&(c[b]=d,c[a]=e)};a.swapChildren=function(b,a){for(var c=this.children,e,d,f=0,g=c.length;f<g;f++)if(c[f]==b&&(e=f),c[f]==a&&(d=f),e!=null&&d!=null)break;f!=g&&(c[e]=a,c[d]=b)};a.setChildIndex=function(b,a){for(var c=this.children,e=0,d=c.length;e<d;e++)if(c[e]==b)break;e==d||a<0||a>d||e==a||(c.splice(a,1),a<e&&e--,c.splice(b,e,0))};a.contains=function(b){for(;b;){if(b==this)return true;b=b.parent}return false};a.hitTest=function(b,
-a){return this.getObjectUnderPoint(b,a)!=null};a.getObjectsUnderPoint=function(b,a){var c=[],e=this.localToGlobal(b,a);this._getObjectsUnderPoint(e.x,e.y,c);return c};a.getObjectUnderPoint=function(b,a){var c=this.localToGlobal(b,a);return this._getObjectsUnderPoint(c.x,c.y)};a.clone=function(b){var a=new c;this.cloneProps(a);if(b)for(var h=a.children=[],e=0,d=this.children.length;e<d;e++){var f=this.children[e].clone(b);f.parent=a;h.push(f)}return a};a.toString=function(){return"[Container (name="+
-this.name+")]"};a._tick=function(b){for(var a=this.children.length-1;a>=0;a--){var c=this.children[a];c._tick&&c._tick(b)}if(this.onTick)this.onTick(b)};a._getObjectsUnderPoint=function(b,a,h,e){var d=DisplayObject._hitTestContext,f=DisplayObject._hitTestCanvas,g=this._matrix,k=e&1&&(this.onPress||this.onClick||this.onDoubleClick)||e&2&&(this.onMouseOver||this.onMouseOut);if(this.cacheCanvas)if(this.getConcatenatedMatrix(g),d.setTransform(g.a,g.b,g.c,g.d,g.tx-b,g.ty-a),d.globalAlpha=g.alpha,this.draw(d),
-this._testHit(d)){if(f.width=0,f.width=1,k)return this}else return null;for(var i=this.children.length-1;i>=0;i--){var l=this.children[i];if(l.isVisible()&&l.mouseEnabled)if(l instanceof c)if(k){if(l=l._getObjectsUnderPoint(b,a))return this}else{if(l=l._getObjectsUnderPoint(b,a,h,e),!h&&l)return l}else if(!e||k||e&1&&(l.onPress||l.onClick||l.onDoubleClick)||e&2&&(l.onMouseOver||l.onMouseOut))if(l.getConcatenatedMatrix(g),d.setTransform(g.a,g.b,g.c,g.d,g.tx-b,g.ty-a),d.globalAlpha=g.alpha,l.draw(d),
-this._testHit(d))if(f.width=0,f.width=1,k)return this;else if(h)h.push(l);else return l}return null};j.Container=c})(window);(function(j){var c=function(b){this.initialize(b)},a=c.prototype=new Container;c._snapToPixelEnabled=false;a.autoClear=true;a.canvas=null;a.mouseX=null;a.mouseY=null;a.onMouseMove=null;a.onMouseUp=null;a.onMouseDown=null;a.snapToPixelEnabled=false;a.mouseInBounds=false;a.tickOnUpdate=true;a._activeMouseEvent=null;a._activeMouseTarget=null;a._mouseOverIntervalID=null;a._mouseOverX=0;a._mouseOverY=0;a._mouseOverTarget=null;a.Container_initialize=a.initialize;a.initialize=function(b){this.Container_initialize();
-this.canvas=b instanceof HTMLCanvasElement?b:document.getElementById(b);this._enableMouseEvents(true)};a.update=function(b){if(this.canvas)this.autoClear&&this.clear(),c._snapToPixelEnabled=this.snapToPixelEnabled,this.tickOnUpdate&&this._tick(b),this.draw(this.canvas.getContext("2d"),false,this.getConcatenatedMatrix(this._matrix))};a.tick=a.update;a.clear=function(){if(this.canvas){var b=this.canvas.getContext("2d");b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,this.canvas.width,this.canvas.height)}};
-a.toDataURL=function(b,a){a||(a="image/png");var c=this.canvas.getContext("2d"),e=this.canvas.width,d=this.canvas.height,f;if(b){f=c.getImageData(0,0,e,d);var g=c.globalCompositeOperation;c.globalCompositeOperation="destination-over";c.fillStyle=b;c.fillRect(0,0,e,d)}var k=this.canvas.toDataURL(a);if(b)c.clearRect(0,0,e,d),c.putImageData(f,0,0),c.globalCompositeOperation=g;return k};a.enableMouseOver=function(b){if(this._mouseOverIntervalID)clearInterval(this._mouseOverIntervalID),this._mouseOverIntervalID=
-null;if(b==null)b=20;else if(b<=0)return;var a=this;this._mouseOverIntervalID=setInterval(function(){a._testMouseOver()},1E3/Math.min(50,b));this._mouseOverX=NaN;this._mouseOverTarget=null};a.clone=function(){var b=new c(null);this.cloneProps(b);return b};a.toString=function(){return"[Stage (name="+this.name+")]"};a._enableMouseEvents=function(){var b=this,a=j.addEventListener?j:document;a.addEventListener("mouseup",function(a){b._handleMouseUp(a)},false);a.addEventListener("mousemove",function(a){b._handleMouseMove(a)},
-false);a.addEventListener("dblclick",function(a){b._handleDoubleClick(a)},false);this.canvas&&this.canvas.addEventListener("mousedown",function(a){b._handleMouseDown(a)},false)};a._handleMouseMove=function(b){if(this.canvas){if(!b)b=j.event;var a=this.mouseInBounds;this._updateMousePosition(b.pageX,b.pageY);if(a||this.mouseInBounds){b=new MouseEvent("onMouseMove",this.mouseX,this.mouseY,this,b);if(this.onMouseMove)this.onMouseMove(b);if(this._activeMouseEvent&&this._activeMouseEvent.onMouseMove)this._activeMouseEvent.onMouseMove(b)}}else this.mouseX=
-this.mouseY=null};a._updateMousePosition=function(b,a){var c=this.canvas;do b-=c.offsetLeft,a-=c.offsetTop;while(c=c.offsetParent);if(this.mouseInBounds=b>=0&&a>=0&&b<this.canvas.width&&a<this.canvas.height)this.mouseX=b,this.mouseY=a};a._handleMouseUp=function(b){var a=new MouseEvent("onMouseUp",this.mouseX,this.mouseY,this,b);if(this.onMouseUp)this.onMouseUp(a);if(this._activeMouseEvent&&this._activeMouseEvent.onMouseUp)this._activeMouseEvent.onMouseUp(a);if(this._activeMouseTarget&&this._activeMouseTarget.onClick&&
-this._getObjectsUnderPoint(this.mouseX,this.mouseY,null,true,this._mouseOverIntervalID?3:1)==this._activeMouseTarget)this._activeMouseTarget.onClick(new MouseEvent("onClick",this.mouseX,this.mouseY,this._activeMouseTarget,b));this._activeMouseEvent=this._activeMouseTarget=null};a._handleMouseDown=function(b){if(this.onMouseDown)this.onMouseDown(new MouseEvent("onMouseDown",this.mouseX,this.mouseY,this,b));var a=this._getObjectsUnderPoint(this.mouseX,this.mouseY,null,this._mouseOverIntervalID?3:1);
-if(a){if(a.onPress instanceof Function&&(b=new MouseEvent("onPress",this.mouseX,this.mouseY,a,b),a.onPress(b),b.onMouseMove||b.onMouseUp))this._activeMouseEvent=b;this._activeMouseTarget=a}};a._testMouseOver=function(){if(!(this.mouseX==this._mouseOverX&&this.mouseY==this._mouseOverY&&this.mouseInBounds)){var b=null;if(this.mouseInBounds)b=this._getObjectsUnderPoint(this.mouseX,this.mouseY,null,3),this._mouseOverX=this.mouseX,this._mouseOverY=this.mouseY;if(this._mouseOverTarget!=b){if(this._mouseOverTarget&&
-this._mouseOverTarget.onMouseOut)this._mouseOverTarget.onMouseOut(new MouseEvent("onMouseOut",this.mouseX,this.mouseY,this._mouseOverTarget));if(b&&b.onMouseOver)b.onMouseOver(new MouseEvent("onMouseOver",this.mouseX,this.mouseY,b));this._mouseOverTarget=b}}};a._handleDoubleClick=function(b){if(this.onDoubleClick)this.onDoubleClick(new MouseEvent("onDoubleClick",this.mouseX,this.mouseY,this,b));var a=this._getObjectsUnderPoint(this.mouseX,this.mouseY,null,this._mouseOverIntervalID?3:1);if(a&&a.onDoubleClick instanceof
-Function)a.onDoubleClick(new MouseEvent("onPress",this.mouseX,this.mouseY,a,b))};j.Stage=c})(window);(function(j){var c=function(b){this.initialize(b)},a=c.prototype=new DisplayObject;a.image=null;a.snapToPixel=true;a.sourceRect=null;a.DisplayObject_initialize=a.initialize;a.initialize=function(b){this.DisplayObject_initialize();typeof b=="string"?(this.image=new Image,this.image.src=b):this.image=b};a.isVisible=function(){return this.visible&&this.alpha>0&&this.scaleX!=0&&this.scaleY!=0&&this.image&&(this.image.complete||this.image.getContext||this.image.readyState>=2)};a.DisplayObject_draw=a.draw;
-a.draw=function(b,a){if(this.DisplayObject_draw(b,a))return true;var c=this.sourceRect;c?b.drawImage(this.image,c.x,c.y,c.width,c.height,0,0,c.width,c.height):b.drawImage(this.image,0,0);return true};a.clone=function(){var b=new c(this.image);this.cloneProps(b);return b};a.toString=function(){return"[Bitmap (name="+this.name+")]"};j.Bitmap=c})(window);(function(j){var c=function(b){this.initialize(b)},a=c.prototype=new DisplayObject;a.onAnimationEnd=null;a.currentFrame=-1;a.currentAnimation=null;a.paused=true;a.spriteSheet=null;a.snapToPixel=true;a.offset=0;a.currentAnimationFrame=0;a._advanceCount=0;a._animation=null;a.DisplayObject_initialize=a.initialize;a.initialize=function(b){this.DisplayObject_initialize();this.spriteSheet=b};a.isVisible=function(){return this.visible&&this.alpha>0&&this.scaleX!=0&&this.scaleY!=0&&this.spriteSheet.complete&&
-this.currentFrame>=0};a.DisplayObject_draw=a.draw;a.draw=function(b,a){if(this.DisplayObject_draw(b,a))return true;this._normalizeFrame();var c=this.spriteSheet.getFrame(this.currentFrame);if(c!=null){var e=c.rect;b.drawImage(c.image,e.x,e.y,e.width,e.height,-c.regX,-c.regY,e.width,e.height);return true}};a.play=function(){this.paused=false};a.stop=function(){this.paused=true};a.gotoAndPlay=function(b){this.paused=false;this._goto(b)};a.gotoAndStop=function(b){this.paused=true;this._goto(b)};a.advance=
-function(){this._animation?this.currentAnimationFrame++:this.currentFrame++;this._normalizeFrame()};a.clone=function(){var b=new c(this.spriteSheet);this.cloneProps(b);return b};a.toString=function(){return"[BitmapAnimation (name="+this.name+")]"};a._tick=function(b){var a=this._animation?this._animation.frequency:1;!this.paused&&(++this._advanceCount+this.offset)%a==0&&this.advance();if(this.onTick)this.onTick(b)};a._normalizeFrame=function(){var b=this._animation;if(b)if(this.currentAnimationFrame>=
-b.frames.length){if(b.next?this._goto(b.next):(this.paused=true,this.currentAnimationFrame=b.frames.length-1,this.currentFrame=b.frames[this.currentAnimationFrame]),this.onAnimationEnd)this.onAnimationEnd(this,b.name)}else this.currentFrame=b.frames[this.currentAnimationFrame];else if(this.currentFrame>=this.spriteSheet.getNumFrames()&&(this.currentFrame=0,this.onAnimationEnd))this.onAnimationEnd(this,null)};a.DisplayObject_cloneProps=a.cloneProps;a.cloneProps=function(b){this.DisplayObject_cloneProps(b);
-b.onAnimationEnd=this.onAnimationEnd;b.currentFrame=this.currentFrame;b.currentAnimation=this.currentAnimation;b.paused=this.paused;b.offset=this.offset;b._animation=this._animation;b.currentAnimationFrame=this.currentAnimationFrame};a._goto=function(b){if(isNaN(b)){var a=this.spriteSheet.getAnimation(b);if(a)this.currentAnimationFrame=0,this._animation=a,this.currentAnimation=b,this._normalizeFrame()}else this.currentAnimation=this._animation=null,this.currentFrame=b};j.BitmapAnimation=c})(window);(function(j){var c=function(b){this.initialize(b)},a=c.prototype=new DisplayObject;a.graphics=null;a.DisplayObject_initialize=a.initialize;a.initialize=function(b){this.DisplayObject_initialize();this.graphics=b?b:new Graphics};a.isVisible=function(){return this.visible&&this.alpha>0&&this.scaleX!=0&&this.scaleY!=0&&this.graphics};a.DisplayObject_draw=a.draw;a.draw=function(b,a){if(this.DisplayObject_draw(b,a))return true;this.graphics.draw(b);return true};a.clone=function(b){b=new c(b&&this.graphics?
-this.graphics.clone():this.graphics);this.cloneProps(b);return b};a.toString=function(){return"[Shape (name="+this.name+")]"};j.Shape=c})(window);(function(j){var c=function(b,a,c){this.initialize(b,a,c)},a=c.prototype=new DisplayObject;c._workingContext=document.createElement("canvas").getContext("2d");a.text="";a.font=null;a.color=null;a.textAlign=null;a.textBaseline=null;a.maxWidth=null;a.outline=false;a.lineHeight=null;a.lineWidth=null;a.DisplayObject_initialize=a.initialize;a.initialize=function(b,a,c){this.DisplayObject_initialize();this.text=b;this.font=a;this.color=c?c:"#000"};a.isVisible=function(){return Boolean(this.visible&&this.alpha>
-0&&this.scaleX!=0&&this.scaleY!=0&&this.text!=null&&this.text!="")};a.DisplayObject_draw=a.draw;a.draw=function(b,a){if(this.DisplayObject_draw(b,a))return true;this.outline?b.strokeStyle=this.color:b.fillStyle=this.color;b.font=this.font;b.textAlign=this.textAlign?this.textAlign:"start";b.textBaseline=this.textBaseline?this.textBaseline:"alphabetic";for(var c=String(this.text).split(/(?:\r\n|\r|\n)/),e=this.lineHeight==null?this.getMeasuredLineHeight():this.lineHeight,d=0,f=0,g=c.length;f<g;f++){var k=
-b.measureText(c[f]).width;if(this.lineWidth==null||k<this.lineWidth)this._drawTextLine(b,c[f],d);else{for(var k=c[f].split(/(\s)/),i=k[0],l=1,j=k.length;l<j;l+=2)b.measureText(i+k[l]+k[l+1]).width>this.lineWidth?(this._drawTextLine(b,i,d),d+=e,i=k[l+1]):i+=k[l]+k[l+1];this._drawTextLine(b,i,d)}d+=e}return true};a.getMeasuredWidth=function(){return this._getWorkingContext().measureText(this.text).width};a.getMeasuredLineHeight=function(){return this._getWorkingContext().measureText("M").width*1.2};
-a.clone=function(){var b=new c(this.text,this.font,this.color);this.cloneProps(b);return b};a.toString=function(){return"[Text (text="+(this.text.length>20?this.text.substr(0,17)+"...":this.text)+")]"};a.DisplayObject_cloneProps=a.cloneProps;a.cloneProps=function(b){this.DisplayObject_cloneProps(b);b.textAlign=this.textAlign;b.textBaseline=this.textBaseline;b.maxWidth=this.maxWidth;b.outline=this.outline;b.lineHeight=this.lineHeight;b.lineWidth=this.lineWidth};a._getWorkingContext=function(){var b=
-c._workingContext;b.font=this.font;b.textAlign=this.textAlign?this.textAlign:"start";b.textBaseline=this.textBaseline?this.textBaseline:"alphabetic";return b};a._drawTextLine=function(b,a,c){this.outline?b.strokeText(a,0,c,this.maxWidth):b.fillText(a,0,c,this.maxWidth||65535)};j.Text=c})(window);(function(j){var c=function(){throw"SpriteSheetUtils cannot be instantiated";};c._workingCanvas=document.createElement("canvas");c._workingContext=c._workingCanvas.getContext("2d");c.addFlippedFrames=function(a,b,j,h){if(b||j||h){var e=0;b&&c._flip(a,++e,true,false);j&&c._flip(a,++e,false,true);h&&c._flip(a,++e,true,true)}};c.extractFrame=function(a,b){isNaN(b)&&(b=a.getAnimation(b).frames[0]);var j=a.getFrame(b);if(!j)return null;var h=j.rect,e=c._workingCanvas;e.width=h.width;e.height=h.height;
-c._workingContext.drawImage(j.image,h.x,h.y,h.width,h.height,0,0,h.width,h.height);j=new Image;j.src=e.toDataURL("image/png");return j};c._flip=function(a,b,j,h){for(var e=a._images,d=c._workingCanvas,f=c._workingContext,g=e.length/b,k=0;k<g;k++){var i=e[k];i.__tmp=k;d.width=i.width;d.height=i.height;f.setTransform(j?-1:1,0,0,h?-1:1,j?i.width:0,h?i.height:0);f.drawImage(i,0,0);var l=new Image;l.src=d.toDataURL("image/png");l.width=i.width;l.height=i.height;e.push(l)}f=a._frames;d=f.length/b;for(k=
-0;k<d;k++){var i=f[k],o=i.rect.clone(),l=e[i.image.__tmp+g*b],m={image:l,rect:o,regX:i.regX,regY:i.regY};if(j)o.x=l.width-o.x-o.width,m.regX=o.width-i.regX;if(h)o.y=l.height-o.y-o.height,m.regY=o.height-i.regY;f.push(m)}j="_"+(j?"h":"")+(h?"v":"");h=a._animations;a=a._data;e=h.length/b;for(k=0;k<e;k++){f=h[k];i=a[f];g={name:f+j,frequency:i.frequency,next:i.next,frames:[]};i.next&&(g.next+=j);f=i.frames;i=0;for(l=f.length;i<l;i++)g.frames.push(f[i]+d*b);a[g.name]=g;h.push(g.name)}};j.SpriteSheetUtils=
-c})(window);(function(j){var c=function(b){this.initialize(b)},a=c.prototype=new DisplayObject;a.htmlElement=null;a._style=null;a.DisplayObject_initialize=a.initialize;a.initialize=function(b){typeof b=="string"&&(b=document.getElementById(b));this.DisplayObject_initialize();this.mouseEnabled=false;if(this.htmlElement=b)this._style=b.style,this._style.position="absolute",this._style.transformOrigin=this._style.webkitTransformOrigin=this._style.msTransformOrigin=this._style.MozTransformOrigin="0% 0%"};a.isVisible=
-function(){return this.htmlElement!=null};a.draw=function(){if(this.htmlElement!=null){var b=this._matrix,a=this.htmlElement;a.style.opacity=""+b.alpha;a.style.visibility=this.visible?"visible":"hidden";a.style.transform=a.style.webkitTransform=a.style.oTransform=a.style.msTransform=["matrix("+b.a,b.b,b.c,b.d,b.tx,b.ty+")"].join(",");a.style.MozTransform=["matrix("+b.a,b.b,b.c,b.d,b.tx+"px",b.ty+"px)"].join(",");return true}};a.cache=function(){};a.uncache=function(){};a.updateCache=function(){};
-a.hitTest=function(){};a.localToGlobal=function(){};a.globalToLocal=function(){};a.localToLocal=function(){};a.clone=function(){var a=new c;this.cloneProps(a);return a};a.toString=function(){return"[DOMElement (name="+this.name+")]"};a._tick=function(a){if(this.htmlElement!=null&&(this.htmlElement.style.visibility="hidden",this.onTick))this.onTick(a)};j.DOMElement=c})(window);(function(j){var c=function(){this.initialize()},a=c.prototype;a.initialize=function(){};a.getBounds=function(){return new Rectangle(0,0,0,0)};a.applyFilter=function(){};a.toString=function(){return"[Filter]"};a.clone=function(){return new c};j.Filter=c})(window);(function(j){var c=function(){throw"Touch cannot be instantiated";};c.isSupported=function(){return"ontouchstart"in j};c.enable=function(a){if(a!=null&&c.isSupported())a._primaryTouchId=-1,a._handleTouchMoveListener=null,a.canvas.addEventListener("touchstart",function(b){c._handleTouchStart(a,b)},false),document.addEventListener("touchend",function(b){c._handleTouchEnd(a,b)},false)};c._handleTouchStart=function(a,b){b.preventDefault();if(a._primaryTouchId==-1){a._handleTouchMoveListener=a._handleTouchMoveListener||
-function(b){c._handleTouchMove(a,b)};document.addEventListener("touchmove",a._handleTouchMoveListener,false);var j=b.changedTouches[0];a._primaryTouchId=j.identifier;a._updateMousePosition(j.pageX,j.pageY);a._handleMouseDown(j)}};c._handleTouchMove=function(a,b){var j=c._findPrimaryTouch(a,b.changedTouches);j&&a._handleMouseMove(j)};c._handleTouchEnd=function(a,b){var j=c._findPrimaryTouch(a,b.changedTouches);if(j)a._primaryTouchId=-1,a._handleMouseUp(j),document.removeEventListener("touchmove",a._handleTouchMoveListener),
-a._handleTouchMoveListener=null};c._findPrimaryTouch=function(a,b){for(var c=b.length,h=0;h<c;h++){var e=b[h];if(e.identifier==a._primaryTouchId)return e}return null};j.Touch=c})(window);
View
0 lib/easeljs-NEXT.min.js → lib/easeljs-0.5.0.min.js
File renamed without changes.
View
17 lib/movieclip-0.4.1.min.js
@@ -1,17 +0,0 @@
-/*
-* EaselJS
-* Visit http://createjs.com/ for documentation, updates and examples.
-*
-* Copyright (c) 2011 gskinner.com, inc.
-*
-* Distributed under the terms of the MIT license.
-* http://www.opensource.org/licenses/mit-license.html
-*
-* This notice shall be included in all copies or substantial portions of the Software.
-*/
-(function(d){var c=function(b,a,c,e){this.initialize(b,a,c,e)},a=c.prototype=new Container;c.INDEPENDENT="independent";c.SINGLE_FRAME="single";c.SYNCHED="synched";a.startPosition=0;a.loop=true;a.timeline=null;a.paused=false;a._synchOffset=0;a._prevPos=-1;a._prevPosition=0;a.Container_initialize=a.initialize;a.initialize=function(b,a,g,e){this.mode=b||c.INDEPENDENT;this.startPosition=a||0;this.loop=g;props={paused:true,position:a,useTicks:true};this.Container_initialize();this.timeline=new Timeline(null,
-e,props);this._managed={}};a.isVisible=function(){return this.visible&&this.alpha>0&&this.scaleX!=0&&this.scaleY!=0};a.Container_draw=a.draw;a.draw=function(b,a,c){if(this.DisplayObject_draw(b,a))return true;this._updateTimeline();this.Container_draw(b,a,c)};a.play=function(){this.paused=false};a.stop=function(){this.paused=true};a.gotoAndPlay=function(b){this.paused=false;this._goto(b)};a.gotoAndStop=function(b){this.paused=true;this._goto(b)};a.clone=function(){throw"MovieClip cannot be cloned.";
-};a.toString=function(){return"[MovieClip (name="+this.name+")]"};a.Container__tick=a._tick;a._tick=function(){if(!this.paused&&this.mode==c.INDEPENDENT)this._prevPosition=this._prevPos<0?0:this._prevPosition+1;this.Container__tick()};a._goto=function(b){b=this.timeline.resolve(b);if(b!=null)this._prevPosition=b,this._updateTimeline()};a._reset=function(){this._prevPos=-1};a._updateTimeline=function(){var b=this.timeline,a=b._tweens,g=this.children,e=this.mode!=c.INDEPENDENT;b.loop=this.loop==null?
-true:this.loop;e?b.setPosition(this.startPosition+(this.mode==c.SINGLE_FRAME?0:this._synchOffset),Tween.NONE):b.setPosition(this._prevPosition);this._prevPosition=b._prevPosition;if(this._prevPos!=b._prevPos){this._prevPos=b._prevPos;for(var f in this._managed)this._managed[f]=1;for(b=a.length-1;b>=0;b--)if(f=a[b],e=f._target,e!=this)f=f._stepPosition,e instanceof DisplayObject?this._addManagedChild(e,f):this._setState(e.state,f);for(b=g.length-1;b>=0;b--)a=g[b].id,this._managed[a]==1&&(this.removeChildAt(b),
-delete this._managed[a])}};a._setState=function(b,a){if(b)for(var c=0,e=b.length;c<e;c++){var f=b[c],d=f.t,f=f.p,h;for(h in f)d[h]=f[h];this._addManagedChild(d,a)}};a._addManagedChild=function(a,d){if(!a._off){this.addChild(a);if(a instanceof c)a._synchOffset=d,a.mode==c.INDEPENDENT&&(!this._managed[a.id]||this._prevPos==0)&&a._reset();this._managed[a.id]=2}};d.MovieClip=c})(window);
-(function(){var d=function(){throw"MovieClipPlugin cannot be instantiated.";};d.priority=100;d.install=function(){Tween.installPlugin(d,["startPosition"])};d.init=function(c,a,b){if(a=="startPosition"||!(c._target instanceof MovieClip))return b};d.tween=function(c,a,b,d,g,e){return!(c._target instanceof MovieClip)?b:e==1?g[a]:d[a]};d.install()})();
View
18 lib/movieclip-0.5.0.min.js
@@ -0,0 +1,18 @@
+/*
+* EaselJS
+* Visit http://createjs.com/ for documentation, updates and examples.
+*
+* Copyright (c) 2011 gskinner.com, inc.
+*
+* Distributed under the terms of the MIT license.
+* http://www.opensource.org/licenses/mit-license.html
+*
+* This notice shall be included in all copies or substantial portions of the Software.
+*/
+this.createjs=this.createjs||{};
+(function(){var d=function(b,a,c,f){this.initialize(b,a,c,f)},a=d.prototype=new createjs.Container;d.INDEPENDENT="independent";d.SINGLE_FRAME="single";d.SYNCHED="synched";a.startPosition=0;a.loop=true;a.timeline=null;a.paused=false;a.actionsEnabled=true;a._synchOffset=0;a._prevPos=-1;a._prevPosition=0;a.Container_initialize=a.initialize;a.initialize=function(b,a,c,f){this.mode=b||d.INDEPENDENT;this.startPosition=a||0;this.loop=c;props={paused:true,position:a,useTicks:true};this.Container_initialize();
+this.timeline=new createjs.Timeline(null,f,props);this._managed={}};a.isVisible=function(){return this.visible&&this.alpha>0&&this.scaleX!=0&&this.scaleY!=0};a.Container_draw=a.draw;a.draw=function(b,a,c){if(this.DisplayObject_draw(b,a))return true;this._updateTimeline();this.Container_draw(b,a,c)};a.play=function(){this.paused=false};a.stop=function(){this.paused=true};a.gotoAndPlay=function(b){this.paused=false;this._goto(b)};a.gotoAndStop=function(b){this.paused=true;this._goto(b)};a.clone=function(){throw"MovieClip cannot be cloned.";
+};a.toString=function(){return"[MovieClip (name="+this.name+")]"};a.Container__tick=a._tick;a._tick=function(b){if(!this.paused&&this.mode==d.INDEPENDENT)this._prevPosition=this._prevPos<0?0:this._prevPosition+1;this.Container__tick(b)};a._goto=function(b){b=this.timeline.resolve(b);if(b!=null)this._prevPosition=b,this._updateTimeline()};a._reset=function(){this._prevPos=-1};a._updateTimeline=function(){var b=this.timeline,a=b._tweens,c=this.children,f=this.mode!=d.INDEPENDENT;b.loop=this.loop==null?
+true:this.loop;f?b.setPosition(this.startPosition+(this.mode==d.SINGLE_FRAME?0:this._synchOffset),createjs.Tween.NONE):b.setPosition(this._prevPosition,this.actionsEnabled?null:createjs.Tween.NONE);this._prevPosition=b._prevPosition;if(this._prevPos!=b._prevPos){this._prevPos=b._prevPos;for(var e in this._managed)this._managed[e]=1;for(b=a.length-1;b>=0;b--)if(e=a[b],f=e._target,f!=this)e=e._stepPosition,f instanceof createjs.DisplayObject?this._addManagedChild(f,e):this._setState(f.state,e);for(b=
+c.length-1;b>=0;b--)a=c[b].id,this._managed[a]==1&&(this.removeChildAt(b),delete this._managed[a])}};a._setState=function(b,a){if(b)for(var c=0,f=b.length;c<f;c++){var e=b[c],d=e.t,e=e.p,g;for(g in e)d[g]=e[g];this._addManagedChild(d,a)}};a._addManagedChild=function(b,a){if(!b._off){this.addChild(b);if(b instanceof d)b._synchOffset=a,b.mode==d.INDEPENDENT&&(!this._managed[b.id]||this._prevPos==0)&&b._reset();this._managed[b.id]=2}};createjs.MovieClip=d;var g=function(){throw"MovieClipPlugin cannot be instantiated.";
+};g.priority=100;g.install=function(){createjs.Tween.installPlugin(g,["startPosition"])};g.init=function(b,a,c){if(a=="startPosition"||!(b._target instanceof createjs.MovieClip))return c};g.tween=function(b,a,c,d,e,g){return!(b._target instanceof createjs.MovieClip)?c:g==1?e[a]:d[a]};g.install()})();
View
17 lib/movieclip-NEXT.min.js
@@ -1,17 +0,0 @@
-/*
-* EaselJS
-* Visit http://createjs.com/ for documentation, updates and examples.
-*
-* Copyright (c) 2011 gskinner.com, inc.
-*
-* Distributed under the terms of the MIT license.
-* http://www.opensource.org/licenses/mit-license.html
-*
-* This notice shall be included in all copies or substantial portions of the Software.
-*/
-(function(g){var c=function(b,a,d,f){this.initialize(b,a,d,f)},a=c.prototype=new g.Container;c.INDEPENDENT="independent";c.SINGLE_FRAME="single";c.SYNCHED="synched";a.startPosition=0;a.loop=true;a.timeline=null;a.paused=false;a.actionsEnabled=true;a._synchOffset=0;a._prevPos=-1;a._prevPosition=0;a.Container_initialize=a.initialize;a.initialize=function(b,a,d,f){this.mode=b||c.INDEPENDENT;this.startPosition=a||0;this.loop=d;props={paused:true,position:a,useTicks:true};this.Container_initialize();this.timeline=
-new g.Timeline(null,f,props);this._managed={}};a.isVisible=function(){return this.visible&&this.alpha>0&&this.scaleX!=0&&this.scaleY!=0};a.Container_draw=a.draw;a.draw=function(b,a,d){if(this.DisplayObject_draw(b,a))return true;this._updateTimeline();this.Container_draw(b,a,d)};a.play=function(){this.paused=false};a.stop=function(){this.paused=true};a.gotoAndPlay=function(b){this.paused=false;this._goto(b)};a.gotoAndStop=function(b){this.paused=true;this._goto(b)};a.clone=function(){throw"MovieClip cannot be cloned.";
-};a.toString=function(){return"[MovieClip (name="+this.name+")]"};a.Container__tick=a._tick;a._tick=function(){if(!this.paused&&this.mode==c.INDEPENDENT)this._prevPosition=this._prevPos<0?0:this._prevPosition+1;this.Container__tick()};a._goto=function(b){b=this.timeline.resolve(b);if(b!=null)this._prevPosition=b,this._updateTimeline()};a._reset=function(){this._prevPos=-1};a._updateTimeline=function(){var b=this.timeline,a=b._tweens,d=this.children,f=this.mode!=c.INDEPENDENT;b.loop=this.loop==null?
-true:this.loop;f?b.setPosition(this.startPosition+(this.mode==c.SINGLE_FRAME?0:this._synchOffset),g.Tween.NONE):b.setPosition(this._prevPosition,this.actionsEnabled?null:g.Tween.NONE);this._prevPosition=b._prevPosition;if(this._prevPos!=b._prevPos){this._prevPos=b._prevPos;for(var e in this._managed)this._managed[e]=1;for(b=a.length-1;b>=0;b--)if(e=a[b],f=e._target,f!=this)e=e._stepPosition,f instanceof g.DisplayObject?this._addManagedChild(f,e):this._setState(f.state,e);for(b=d.length-1;b>=0;b--)a=
-d[b].id,this._managed[a]==1&&(this.removeChildAt(b),delete this._managed[a])}};a._setState=function(b,a){if(b)for(var d=0,f=b.length;d<f;d++){var e=b[d],c=e.t,e=e.p,g;for(g in e)c[g]=e[g];this._addManagedChild(c,a)}};a._addManagedChild=function(b,a){if(!b._off){this.addChild(b);if(b instanceof c)b._synchOffset=a,b.mode==c.INDEPENDENT&&(!this._managed[b.id]||this._prevPos==0)&&b._reset();this._managed[b.id]=2}};g.MovieClip=c;var h=function(){throw"MovieClipPlugin cannot be instantiated.";};h.priority=
-100;h.install=function(){g.Tween.installPlugin(h,["startPosition"])};h.init=function(b,a,d){if(a=="startPosition"||!(b._target instanceof g.MovieClip))return d};h.tween=function(a,c,d,f,e,h){return!(a._target instanceof g.MovieClip)?d:h==1?e[c]:f[c]};h.install()})(createjs||(createjs={}));var createjs;
View
2 tutorials/Animation and Ticker/index.html
@@ -99,6 +99,7 @@
<iframe src="timeBased.html" class="demo" longDesc="time based animation, the red circle is using time based animation" width="100%" height="250px"></iframe>
<p>
Notice in the above demo how when you change the FPS, the red circle still moves at the same velocity, whereas the blue circle's velocity is relative to the framerate. Also note how at 20fps, the red circle moves very slightly faster than the blue circle, because it accounts for frames that take slightly longer than the expected 50ms.
+ </p>
</section>
<section>
@@ -137,6 +138,7 @@
</textarea>
<p>
You can also add your stage directly as a listener to <code>Ticker</code>, because <code>Stage</code> has a <code>tick</code> method that shortcuts to <code>update</code>. It's rare that you would want to use this, but it can be handy for quick tests. See the source of <a href="onTick.html">onTick.html</a> for an example.
+ </p>
</section>
<section>
View
2 tutorials/Animation and Ticker/onTick.html
@@ -3,7 +3,7 @@
<head>
<title>EaselJS demo: DisplayObject.onTick</title>
<link href="../shared/demo.css" rel="stylesheet" type="text/css">
- <script src="../../lib/easeljs-NEXT.min.js"></script>
+ <script src="../../lib/easeljs-0.5.0.min.js"></script>
<script>
var stage, circle;
View
2 tutorials/Animation and Ticker/pausing.html
@@ -3,7 +3,7 @@
<head>
<title>EaselJS demo: Ticker.setPaused()</title>
<link href="../shared/demo.css" rel="stylesheet" type="text/css">
- <script src="../../lib/easeljs-NEXT.min.js"></script>
+ <script src="../../lib/easeljs-0.5.0.min.js"></script>
<script>
var stage, pauseCircle, goCircle, output;
View
2 tutorials/Animation and Ticker/simple.html
@@ -3,7 +3,7 @@
<head>
<title>EaselJS demo: Simple animation</title>
<link href="../shared/demo.css" rel="stylesheet" type="text/css">
- <script src="../../lib/easeljs-NEXT.min.js"></script>
+ <script src="../../lib/easeljs-0.5.0.min.js"></script>
<script>
var stage, circle;
View
2 tutorials/Animation and Ticker/timeBased.html
@@ -3,7 +3,7 @@
<head>
<title>EaselJS demo: Time based animation</title>
<link href="../shared/demo.css" rel="stylesheet" type="text/css">
- <script src="../../lib/easeljs-NEXT.min.js"></script>
+ <script src="../../lib/easeljs-0.5.0.min.js"></script>
<script>
var stage, timeCircle, tickCircle;
View
2 tutorials/Getting Started/demo.html
@@ -3,7 +3,7 @@
<head>
<title>EaselJS demo: Getting started</title>
<link href="../shared/demo.css" rel="stylesheet" type="text/css">
- <script src="../../lib/easeljs-NEXT.min.js"></script>
+ <script src="../../lib/easeljs-0.5.0.min.js"></script>
<script>
function init() {
var stage = new createjs.Stage("demoCanvas");
View
2 tutorials/Getting Started/index.html
@@ -36,7 +36,7 @@
<!DOCTYPE html>
<html>
<head>
- <script src="../../lib/easeljs-NEXT.min.js"></script>
+ <script src="../../lib/easeljs-0.5.0.min.js"></script>
<script>
function init() {
// code here.
View
2 tutorials/HitTest/globalToLocal.html
@@ -3,7 +3,7 @@
<head>
<title>EaselJS demo: globalToLocal</title>
<link href="../shared/demo.css" rel="stylesheet" type="text/css">
- <script src="../../lib/easeljs-NEXT.min.js"></script>
+ <script src="../../lib/easeljs-0.5.0.min.js"></script>
<script>
var stage, holder;
function init() {
View
2 tutorials/HitTest/hitTest.html
@@ -3,7 +3,7 @@
<head>
<title>EaselJS demo: hitTest</title>
<link href="../shared/demo.css" rel="stylesheet" type="text/css">
- <script src="../../lib/easeljs-NEXT.min.js"></script>
+ <script src="../../lib/easeljs-0.5.0.min.js"></script>
<script>
var stage, circle;
function init() {
View
2 tutorials/HitTest/localToLocal.html
@@ -3,7 +3,7 @@
<head>
<title>EaselJS demo: localToLocal</title>
<link href="../shared/demo.css" rel="stylesheet" type="text/css">
- <script src="../../lib/easeljs-NEXT.min.js"></script>
+ <script src="../../lib/easeljs-0.5.0.min.js"></script>
<script>
var stage, arm;
function init() {
View
2 tutorials/Inheritance/demo.html
@@ -3,7 +3,7 @@
<head>
<title>EaselJS demo: Inheritance</title>
<link href="../shared/demo.css" rel="stylesheet" type="text/css">
- <script src="../../lib/easeljs-NEXT.min.js"></script>
+ <script src="../../lib/easeljs-0.5.0.min.js"></script>
<script src="Button.js"></script>
<script>
var stage, holder;
View
30 tutorials/Mouse Interaction/basic.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>EaselJS demo: onClick</title>
+ <link href="../shared/demo.css" rel="stylesheet" type="text/css">
+ <script src="../../lib/easeljs-0.5.0.min.js"></script>
+ <script>
+ function init() {
+ var stage = new createjs.Stage("demoCanvas");
+
+ var circle = new createjs.Shape();
+ circle.graphics.beginFill("red").drawCircle(0, 0, 50);
+ circle.x = 100;
+ circle.y = 100;
+
+ circle.onClick = function() {
+ alert("Click!");
+ }
+
+ stage.addChild(circle);
+ stage.update();
+ }
+ </script>
+</head>
+<body onLoad="init();">
+ <canvas id="demoCanvas" width="500" height="200">
+ alternate content
+ </canvas>
+</body>
+</html>
View
54 tutorials/Mouse Interaction/container.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>EaselJS demo: Container events</title>
+ <link href="../shared/demo.css" rel="stylesheet" type="text/css">
+ <script src="../../lib/easeljs-0.5.0.min.js"></script>
+ <script>
+ var stage, output;
+
+ function init() {
+ stage = new createjs.Stage("demoCanvas");
+
+ // this lets our drag continue to track the mouse even when it leaves the canvas:
+ //stage.mouseMoveOutside = true;
+
+ var background = new createjs.Shape();
+ background.name = "background";
+ background.graphics.beginFill("red").drawRoundRect(0, 0, 200, 60, 10);
+
+ var label = new createjs.Text("click me!", "bold 24px Arial", "#FFFFFF");
+ label.name = "label";
+ label.textAlign = "center";
+ label.textBaseline = "middle";
+ label.x = 200/2;
+ label.y = 60/2;
+
+ var button = new createjs.Container();
+ button.name = "button";
+ button.x = 50;
+ button.y = 25;
+ button.addChild(background, label);
+ stage.addChild(button);
+
+ background.onClick = label.onClick = handleClick;
+
+ // if we define a handler on button, then it will be called, but handlers
+ // on the children will not. You can comment out the next line to test:
+ button.onClick = handleClick;
+
+ createjs.Ticker.addListener(stage);
+ stage.update();
+ }
+
+ function handleClick(evt) {
+ alert("Clicked on: "+evt.target.name);
+ }
+ </script>
+</head>
+<body onLoad="init();">
+ <canvas id="demoCanvas" width="500" height="100">
+ alternate content
+ </canvas>
+</body>
+</html>
View
50 tutorials/Mouse Interaction/drag.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>EaselJS demo: Dragging</title>
+ <link href="../shared/demo.css" rel="stylesheet" type="text/css">
+ <script src="../../lib/easeljs-0.5.0.min.js"></script>
+ <script>
+ var stage, output;
+
+ function init() {
+ stage = new createjs.Stage("demoCanvas");
+
+ // this lets our drag continue to track the mouse even when it leaves the canvas:
+ // play with commenting this out to see the difference.
+ stage.mouseMoveOutside = true;
+
+ var circle = new createjs.Shape();
+ circle.graphics.beginFill("red").drawCircle(0, 0, 50);
+
+ var label = new createjs.Text("drag me", "bold 14px Arial", "#FFFFFF");
+ label.textAlign = "center";
+ label.y = -7;
+
+ var dragger = new createjs.Container();
+ dragger.x = dragger.y = 100;
+ dragger.addChild(circle, label);
+ stage.addChild(dragger);
+
+ dragger.onPress = function(evt) {
+ var offset = {x:evt.target.x-evt.stageX, y:evt.target.y-evt.stageY};
+
+ // add a handler to the event object's onMouseMove callback
+ // this will be active until the user releases the mouse button:
+ evt.onMouseMove = function(ev) {
+ ev.target.x = ev.stageX+offset.x;
+ ev.target.y = ev.stageY+offset.y;
+ }
+ }
+
+ createjs.Ticker.addListener(stage);
+ stage.update();
+ }
+ </script>
+</head>
+<body onLoad="init();">
+ <canvas id="demoCanvas" width="500" height="200">
+ alternate content
+ </canvas>
+</body>
+</html>
View
53 tutorials/Mouse Interaction/events.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>EaselJS demo: Mouse Events</title>
+ <link href="../shared/demo.css" rel="stylesheet" type="text/css">
+ <script src="../../lib/easeljs-0.5.0.min.js"></script>
+ <script>
+ var stage, output;
+
+ function init() {
+ stage = new createjs.Stage("demoCanvas");
+
+ // to get onMouseOver & onMouseOut events, we need to enable them on the stage:
+ stage.enableMouseOver();
+
+ output = new createjs.Text("Test press, click, doubleclick, mouseover, and mouseout", "14px Arial");
+ output.x = output.y = 10;
+ stage.addChild(output);
+
+ var circle = new createjs.Shape();
+ circle.graphics.beginFill("red").drawCircle(0, 0, 50);
+ circle.x = circle.y = 100;
+ circle.name = "circle";
+ stage.addChild(circle);
+
+ var square = new createjs.Shape();
+ square.graphics.beginFill("green").drawRect(-50, -50, 100, 100);
+ square.x = 250;
+ square.y = 100;
+ square.name = "square";
+ stage.addChild(square);
+
+ // add a handler for all the events we're interested in:
+ circle.onClick = circle.onPress = circle.onDoubleClick = circle.onMouseOver = circle.onMouseOut = handleMouseEvent;
+ square.onClick = square.onPress = square.onDoubleClick = square.onMouseOver = square.onMouseOut = handleMouseEvent;
+
+ stage.update();
+ }
+
+ function handleMouseEvent(evt) {
+ output.text = "evt.target: "+evt.target+", evt.type: "+evt.type;
+
+ // to save CPU, we're only updating when we need to, instead of on a tick:1
+ stage.update();
+ }
+ </script>
+</head>
+<body onLoad="init();">
+ <canvas id="demoCanvas" width="500" height="200">
+ alternate content
+ </canvas>
+</body>
+</html>
View
42 tutorials/Mouse Interaction/hitArea.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>EaselJS demo: onClick</title>
+ <link href="../shared/demo.css" rel="stylesheet" type="text/css">
+ <script src="../../lib/easeljs-0.5.0.min.js"></script>
+ <script>
+ function init() {
+ var stage = new createjs.Stage("demoCanvas");
+ stage.enableMouseOver();
+
+ var label1 = new createjs.Text("text without hitArea", "48px Arial", "#F00");
+ label1.x = label1.y = 10;
+ label1.alpha = 0.5;
+
+ var label2 = new createjs.Text("text with hitArea", "48px Arial", "#00F");
+ label2.x = 10;
+ label2.y = 80;
+ label2.alpha = 0.5;
+
+ // create a rectangle shape the same size as the text, and assign it as the hitArea
+ // note that it is never added to the display list.
+ var hit = new createjs.Shape();
+ hit.graphics.beginFill("#000").drawRect(0, 0, label2.getMeasuredWidth(), label2.getMeasuredHeight());
+ label2.hitArea = hit;
+
+ label1.onMouseOver = label2.onMouseOver = function(evt) { evt.target.alpha = 1; }
+ label1.onMouseOut = label2.onMouseOut = function(evt) { evt.target.alpha = 0.5; }
+
+ stage.addChild(label1, label2);
+
+ createjs.Ticker.addListener(stage);
+ stage.update();
+ }
+ </script>
+</head>
+<body onLoad="init();">
+ <canvas id="demoCanvas" width="500" height="150">
+ alternate content
+ </canvas>
+</body>
+</html>
View
184 tutorials/Mouse Interaction/index.html
@@ -0,0 +1,184 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>EaselJS Tutorial: Mouse Interaction</title>
+ <link href="../shared/tutorial.css" rel="stylesheet" type="text/css">
+ <script src="../shared/tutorial.js"></script>
+
+ <!-- SyntaxHighlighter-->
+ <script src="../shared/SyntaxHighlighter/shCore.js"></script>
+ <script src="../shared/SyntaxHighlighter/shBrushJScript.js"></script>
+ <script src="../shared/SyntaxHighlighter/shBrushXml.js"></script>
+ <link href="../shared/SyntaxHighlighter/shCore.css" rel="stylesheet" type="text/css">
+ <link href="../shared/SyntaxHighlighter/shThemeCreateJS.css" rel="stylesheet" type="text/css">
+</head>
+
+<body onLoad="initTutorial();">
+ <article>
+ <header>
+ <h1>EaselJS: Mouse Interaction</h1>
+ <p>
+ <strong>Synopsis:</strong> Learn about mouse events on display objects and the stage.<br>
+ <strong>Topics:</strong> MouseEvent, onClick, onPress, onDoubleClick, onMouseOver, onMouseOut, onMouseMove, onMouseDown, onMouseUp, enableMouseOver, drag and drop, mouseMoveOutside<br>
+ <strong>Target:</strong> EaselJS v0.5.0
+ </p>
+ </header>
+
+ <section>
+ <header>
+ <h2>The Basics</h2>
+ </header>
+ <p>
+ At its core, the EaselJS mouse interaction model is very simple to use - just assign a function handler for one of the mouse events on a display object:
+ <textarea class="brush: js;" readonly>
+circle.onClick = function(evt) { alert("clicked"); }
+ </textarea>
+ </p>
+ <iframe src="basic.html" class="demo" longDesc="the onClick handler" width="100%" height="220px"></iframe>
+ <p>
+ There are a number of events you can listen for on display objects: <code>onPress</code>, <code>onClick</code>, <code>onDoubleClick</code>, <code>onMouseOver</code>, and <code>onMouseOut</code>.
+ </p>
+ <p>
+ The latter two events have some overhead associated with them, so you need to enable them with <code>stage.enableMouseOver(frequency)</code>. The <code>frequency</code> parameter indicates how many times per second EaselJS should calculate what is currently under the pointer. A higher number is more responsive, but also more computationally expensive. It defaults to 20 times per second.
+ </p>
+ </section>
+
+ <section>
+ <header>
+ <h2>MouseEvent</h2>
+ </header>
+ <p>
+ When a mouse handler is triggered, it is called with a single parameter holding a MouseEvent instance. You can use this object to see what <code>type</code> of event it was, what the <code>target</code> was, get access to the <code>nativeEvent</code> object it was based on, and to check the pointer's <code>stageX</code> and <code>stageY</code> coordinates.
+ <textarea class="brush: js;" readonly>
+circle.onClick = function(evt) {
+ alert("type: "+evt.type+" target: "+evt.target+" stageX: "+evt.stageX);
+}
+ </textarea>
+ </p>
+ <iframe src="events.html" class="demo" longDesc="demonstrating the different mouse event types on display objects" width="100%" height="220px"></iframe>
+ </section>
+
+ <section>
+ <header>
+ <h2>Containers</h2>
+ </header>
+ <p>
+ When you assign a mouse event handler on a <code>Container</code> instance, it will block all mouse events to its children, even if they have their own listeners.
+ </p>
+ <p>
+ The example below has a "button", which is a <code>Container</code> instance containing two children: a background shape, and a text label. All three of these display objects have <code>onClick</code> handlers, but if you click the button, only its handler is called.
+ </p>
+ <iframe src="container.html" class="demo" longDesc="mouse event handlers on containers" width="100%" height="120px"></iframe>
+ <p>
+ If you edit the code for container.html to remove the <code>onClick</code> handler on button, the handlers on background and label will be active.
+ </p>
+ <p>
+ You can also block mouse events to children without assigning a handler by setting <code>mouseChildren</code> to <code>false</code>.
+ <textarea class="brush: js;" readonly>
+myContainer.mouseChildren = false;
+ </textarea>
+ </p>
+ <p>
+ Similarly, you can disable mouse events on any display object without removing its handlers by setting <code>mouseEnabled</code> to <code>false</code>.
+ <textarea class="brush: js;" readonly>
+circle.onClick = function() { alert("Clicked!"); }
+circle.mouseEnabled = false;
+ </textarea>
+ </section>
+
+ <section>
+ <header>
+ <h2>hitArea</h2>
+ </header>
+ <p>
+ Normally, EaselJS will calculate mouse hits on a display object based on its visible, non-transparent pixels. This usually works pretty well, but there may be cases where you want to define a hit target that is different than what is displayed on screen.
+ </p>
+ <p>
+ To do this, you can assign any other display object to be the <code>hitArea</code> for your object. It does not need to be on the display list, and will not be visible, but it will be used for the hit test instead.
+ </p>
+ <p>
+ Hit area display objects are used within the coordinate system (ie. concatenated transformation) of their owner, and as such you can reuse the same display object as the <code>hitArea</code> of multiple objects.
+ </p>
+ <iframe src="hitArea.html" class="demo" longDesc="mouse event handlers on containers" width="100%" height="170px"></iframe>
+ <p>
+ Notice how in this demo, as you roll over the red text, it only registers a hit when the pointer is over a non-transparent pixel, whereas the blue text uses the rectangular <code>hitArea</code> to calculate the hit.
+ </p>
+ </section>
+
+ <section>
+ <header>
+ <h2>Stage mouse events</h2>
+ </header>
+ <p>
+ If you assign a normal mouse event handler to the stage, it will block mouse events to all of its children. Also, just like every other display object, you will only get events when the mouse is over a non-transparent pixel.
+ </p>
+ <p>
+ Stage has a few special mouse events that come in handy for responding to general mouse interactions anywhere within your canvas. <code>onMouseDown</code>, <code>onMouseUp</code> and <code>onMouseMove</code> are called any time a relevant mouse interaction happens anywhere on the canvas.
+ <textarea class="brush: js;" readonly>
+stage.onMouseDown = function(evt) {
+ alert("the canvas was clicked at "+evt.stageX+","+evt.stageY);
+}
+ </textarea>
+ <p>
+ The following demo demonstrates using these events to let you finger paint on the canvas:
+ </p>
+ <iframe src="stage.html" class="demo" longDesc="using stage.onMouseDown, onMouseUp & onMouseMove." width="100%" height="220px"></iframe>
+ <p>
+ By default, you will stop getting <code>onMouseMove</code> events whenever the pointer is outside of the canvas. You can check of this has happened with <code>stage.mouseInBounds</code>.
+ </p>
+ <p>
+ If you'd like to keep getting <code>onMouseMove</code> events when the pointer leaves the canvas, just set <code>mouseMoveOutside</code> to <code>true</code>. The <code>stageX</code> & <code>stageY</code> properties of <code>MouseEvent</code> will always return a value normalized to within your stage bounds, but you can use <code>rawX</code> and <code>rawY</code> to get values that haven't been normalized (this can cause errors if you aren't careful).
+ <textarea class="brush: js;" readonly>
+stage.mouseMoveOutside = true;
+stage.onMouseMove = function(evt) {
+ console.log("stageX/Y: "+evt.stageX+","+evt.stageY); // always in bounds
+ console.log("rawX/Y: "+evt.rawX+","+evt.rawY); // could be < 0, or > width/height
+}
+ </textarea>
+ </p>
+ </section>
+
+ <section>
+ <header>
+ <h2>Drag and drop</h2>
+ </header>
+ <p>
+ EaselJS makes drag and drop functionality very easy to implement. When an <code>onPress</code> handler is called, the <code>MouseEvent</code> that is passed to it has two special mouse handlers of its own, <code>onMouseMove</code> and <code>onMouseUp</code>
+ </p>
+ <p>
+ These handlers work exactly the same as their equivalents on <code>Stage</code> with one major difference - they are only active until the user releases the pointer. It sounds a little strange, but it's really simple to use.
+ </p>
+ <textarea class="brush: js;" readonly>
+circle.onPress = function(evt) {
+ // add handlers directly to the event object:
+ evt.onMouseMove = function(evt) {
+ evt.target.x = evt.stageX;
+ evt.target.y = evt.stageY;
+ }
+ evt.onMouseUp = function(evt) { console.log("up"); }
+}
+ </textarea>
+ <p>
+ Check out the source for the demo below for a simple example of this in action. It's also a great place to test out the <code>mouseMoveOutside</code> property.
+ </p>
+ <iframe src="drag.html" class="demo" longDesc="implementing drag and drop" width="100%" height="220px"></iframe>
+ </section>
+
+ <section>
+ <header>
+ <h2>Other useful APIs</h2>
+ </header>
+ <p>
+ Other methods that are relevant to advanced mouse interactions are:<ul>
+ <li> <code>Container.getObjectUnderPoint()</code> returns the top most display object under the specified point.
+ <li> <code>Container.getObjectsUnderPoint()</code> returns all display objects under the specified point.
+ <li> <code>DisplayObject.hitTest()</code> returns true if the specified point in the display object is non-transparent.
+ </ul>
+ Check out the API documentation and the HitTest tutorial for more information.
+ </p>
+ </section>
+
+ </article>
+</body>
+</html>
View
52 tutorials/Mouse Interaction/stage.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>EaselJS demo: Mouse Events on Stage</title>
+ <link href="../shared/demo.css" rel="stylesheet" type="text/css">
+ <script src="../../lib/easeljs-0.5.0.min.js"></script>
+ <script>
+ var stage, label, shape, oldX, oldY, size, color;
+
+ function init() {
+ stage = new createjs.Stage("demoCanvas");
+
+ label = new createjs.Text("finger paint", "24px Arial");
+ label.x = label.y = 10;
+
+ shape = new createjs.Shape();
+ stage.addChild(shape, label);
+
+ // set up our defaults:
+ color = "#0FF";
+ size = 2;
+
+ // add handler for stage mouse events:
+ stage.onMouseDown = function() {
+ size = 10;
+ }
+ stage.onMouseUp = function() {
+ color = createjs.Graphics.getHSL(Math.random()*360, 100, 50);
+ size = 2;
+ }
+ stage.onMouseMove = function(evt) {
+ if (oldX) {
+ shape.graphics.beginStroke(color)
+ .setStrokeStyle(size, "round")
+ .moveTo(oldX, oldY)
+ .lineTo(evt.stageX, evt.stageY);
+ stage.update();
+ }
+ oldX = evt.stageX;
+ oldY = evt.stageY;
+ }
+
+ stage.update();
+ }
+ </script>
+</head>
+<body onLoad="init();">
+ <canvas id="demoCanvas" width="500" height="200">
+ alternate content
+ </canvas>
+</body>
+</html>
View
6 tutorials/shared/demo.css
@@ -1,5 +1,9 @@
body {
margin: 0;
- padding: 8px;
+ padding: 7px;
background-color: rgba(255,255,255,0);
+}
+
+canvas {
+ border: solid 1px rgba(0,0,0,0.05);
}

0 comments on commit 0af02d8

Please sign in to comment.