Permalink
Browse files

Updated SoundJS to use the createjs namespace

* Modifed core libs to use namespace
* Updated the demos to work
* Recompiled lib, docs, and flashplugin
* Removed FlashPlugin in assets/ and pointed to the one in src
* Added FlashPluginShim, which is the same as the FlashPlugin.fla, but without the list. Replaced the swf in src.
  • Loading branch information...
1 parent 48ebf09 commit 4d6b5a31de88a275d73c07d9ced8c1f828d096c8 @lannymcnie lannymcnie committed Aug 6, 2012
View
1 .gitignore
@@ -0,0 +1 @@
+.DS_Store
View
BIN dev/FlashAudioPluginShim.fla
Binary file not shown.
View
2 dev/com/gskinner/soundjs/FlashAudioPlugin.as
@@ -1 +1 @@
-package com.gskinner.soundjs {
+package com.gskinner.soundjs {
View
BIN docs/SoundJS_docs-NEXT.zip
Binary file not shown.
View
34 examples/Convolution.html
@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=9" /> <!-- req for IE 9 else audio tag won't work -->
<title>SoundJS: Convolution Example</title>
- <script type="text/javascript" src="http://code.createjs.com/preloadjs-0.1.0.min.js"></script>
+ <script type="text/javascript" src="./assets/preloadjs-NEXT.min.js"></script>
<script type="text/javascript" src="../src/soundjs/SoundJS.js"></script>
<script type="text/javascript" src="../src/soundjs/HTMLAudioPlugin.js"></script>
@@ -25,8 +25,8 @@
document.getElementById("header").style.display = "none";
}
- SoundJS.FlashPlugin.BASE_PATH = "assets/" // Initialize the base path from this document to the Flash Plugin
- if (!SoundJS.checkPlugin(true)) {
+ createjs.FlashPlugin.BASE_PATH = "../src/soundjs/" // Initialize the base path from this document to the Flash Plugin
+ if (!createjs.SoundJS.checkPlugin(true)) {
document.getElementById("error").style.display = "block";
document.getElementById("content").style.display = "none";
return;
@@ -42,15 +42,15 @@
];
- preload = new PreloadJS();
+ preload = new createjs.PreloadJS();
preload.onComplete = handleLoadComplete;
- preload.installPlugin(SoundJS);
+ preload.installPlugin(createjs.SoundJS);
preload.loadManifest(manifest);
}
function stop() {
if (preload != null) { preload.close(); }
- SoundJS.stop();
+ createjs.SoundJS.stop();
}
function handleLoadComplete() {
@@ -71,23 +71,23 @@
$("#p11").removeClass("active"); // Reset UI
// Play "dong" immediately
- instance = SoundJS.play("dong", SoundJS.INTERRUPT_NONE, 0, 400, -1);
+ instance = createjs.SoundJS.play("dong", createjs.SoundJS.INTERRUPT_NONE, 0, 400, -1);
$("#p01").addClass("active");
// Play "gull" immediately
- SoundJS.play("gull", SoundJS.INTERRUPT_NONE);
+ createjs.SoundJS.play("gull", createjs.SoundJS.INTERRUPT_NONE);
$("#p00").addClass("active");
// Play "gull" after 150 ms. Interrupts first gull sound
- SoundJS.play("gull", SoundJS.INTERRUPT_ANY, 150);
+ createjs.SoundJS.play("gull", createjs.SoundJS.INTERRUPT_ANY, 150);
setTimeout(function(){
$("#p00").removeClass("active")
$("#p01").removeClass("active")
$("#p02").addClass("active");
}, 150);
// Play "rat" after 1 second
- SoundJS.play("rat", SoundJS.INTERRUPT_NONE, 1000);
+ createjs.SoundJS.play("rat", createjs.SoundJS.INTERRUPT_NONE, 1000);
setTimeout(function(){
$("#p02").removeClass("active")
$("#p03").addClass("active");
@@ -96,49 +96,49 @@
// Play "rat" immediately after previous. Interrupts previous rat sound.
setTimeout(function(){
$("#p03").removeClass("active")
- SoundJS.play("rat", SoundJS.INTERRUPT_ANY);
+ createjs.SoundJS.play("rat", createjs.SoundJS.INTERRUPT_ANY);
$("#p04").addClass("active");
}, 1050);
// Play "dong" after another second. Should start a new channel.
setTimeout(function(){
$("#p04").removeClass("active")
- SoundJS.play("dong", SoundJS.INTERRUPT_NONE, 0, 1000);
+ createjs.SoundJS.play("dong", createjs.SoundJS.INTERRUPT_NONE, 0, 1000);
$("#p05").addClass("active");
}, 2500);
// Play "dong" after another second. Should start a new channel.
setTimeout(function(){
$("#p05").removeClass("active")
- SoundJS.play("dong", SoundJS.INTERRUPT_NONE, 0, 1000);
+ createjs.SoundJS.play("dong", createjs.SoundJS.INTERRUPT_NONE, 0, 1000);
$("#p06").addClass("active");
}, 3500);
// Wait half a second, then pause all "dong" sounds.
setTimeout(function(){
$("#p06").removeClass("active")
- SoundJS.pause("dong");
+ createjs.SoundJS.pause("dong");
$("#p07").addClass("active");
}, 4000);
// Play another "dong" sound. instances are used up, so it should fail.
setTimeout(function(){
$("#p07").removeClass("active")
- SoundJS.play("dong", SoundJS.INTERRUPT_NONE, 0, 1000);
+ createjs.SoundJS.play("dong", createjs.SoundJS.INTERRUPT_NONE, 0, 1000);
$("#p08").addClass("active");
}, 4500);
// Wait 3 seconds, then resume all paused sounds.
setTimeout(function(){
$("#p08").removeClass("active")
- SoundJS.resume();
+ createjs.SoundJS.resume();
$("#p09").addClass("active");
}, 8000);
// Wait another second, and play "dong" sound. Previous instance should be complete, so it will work.
setTimeout(function(){
$("#p09").removeClass("active")
- SoundJS.play("dong", SoundJS.INTERRUPT_NONE, 0, 1000);
+ createjs.SoundJS.play("dong", createjs.SoundJS.INTERRUPT_NONE, 0, 1000);
$("#p10").addClass("active");
}, 9000);
View
38 examples/Game.html
@@ -4,8 +4,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>CreateJS Example: Space Rocks Game</title>
- <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/easeljs-0.4.1.min.js"></script>
+ <script type="text/javascript" src="./assets/preloadjs-NEXT.min.js"></script>
+ <script type="text/javascript" src="./assets/easeljs-NEXT.min.js"></script>
<script type="text/javascript" src="../src/soundjs/SoundJS.js"></script>
<script type="text/javascript" src="../src/soundjs/HTMLAudioPlugin.js"></script>
@@ -72,8 +72,8 @@
document.getElementById("header").style.display = "none";
}
- SoundJS.FlashPlugin.BASE_PATH = "assets/";
- if (!SoundJS.checkPlugin(true)) {
+ createjs.FlashPlugin.BASE_PATH = "../src/soundjs/" // Initialize the base path from this document to the Flash Plugin
+ if (!createjs.SoundJS.checkPlugin(true)) {
document.getElementById("error").style.display = "block";
document.getElementById("content").style.display = "none";
return;
@@ -88,16 +88,14 @@
{id:"music", src:"assets/18-machinae_supremacy-lord_krutors_dominion.mp3|../../assets/18-machinae_supremacy-lord_krutors_dominion.ogg"}
];
- SoundJS.FlashPlugin.BASE_PATH = "assets/" // Initialize the base path from this document to the Flash Plugin
-
- preload = new PreloadJS();
+ preload = new createjs.PreloadJS();
preload.onComplete = doneLoading;
- preload.installPlugin(SoundJS);
+ preload.installPlugin(createjs.SoundJS);
preload.loadManifest(manifest);
canvas = document.getElementById("gameCanvas");
- stage = new Stage(canvas);
- messageField = new Text("Loading", "bold 24px Arial", "#FFFFFF");
+ stage = new createjs.Stage(canvas);
+ messageField = new createjs.Text("Loading", "bold 24px Arial", "#FFFFFF");
messageField.maxWidth = 1000;
messageField.textAlign = "center";
messageField.x = canvas.width / 2;
@@ -110,7 +108,7 @@
function stop() {
if (preload != null) { preload.close(); }
- SoundJS.stop();
+ createjs.SoundJS.stop();
}
function updateLoading() {
@@ -121,7 +119,7 @@
function doneLoading() {
clearInterval(loadingInterval);
- scoreField = new Text("0", "bold 12px Arial", "#FFFFFF");
+ scoreField = new createjs.Text("0", "bold 12px Arial", "#FFFFFF");
scoreField.textAlign = "right";
scoreField.x = canvas.width - 10;
scoreField.y = 22;
@@ -130,7 +128,7 @@
messageField.text = "Welcome: Click to play";
// start the music
- SoundJS.play("music", SoundJS.INTERRUPT_NONE, 0, 0, -1, 0.4);
+ createjs.SoundJS.play("music", createjs.SoundJS.INTERRUPT_NONE, 0, 0, -1, 0.4);
watchRestart();
}
@@ -148,7 +146,7 @@
stage.removeChild(messageField);
// indicate the player is now on screen
- SoundJS.play("begin");
+ createjs.SoundJS.play("begin");
restart();
}
@@ -182,7 +180,7 @@
stage.addChild(ship);
//start game timer
- Ticker.addListener(window);
+ createjs.Ticker.addListener(window);
}
function tick() {
@@ -263,7 +261,7 @@
watchRestart();
//play death sound
- SoundJS.play("death", SoundJS.INTERRUPT_ANY);
+ createjs.SoundJS.play("death", createjs.SoundJS.INTERRUPT_ANY);
continue;
}
@@ -310,7 +308,7 @@
bulletStream[bullet].active = false;
// play sound
- SoundJS.play("break", SoundJS.INTERUPT_LATE, 0, 0.8);
+ createjs.SoundJS.play("break", createjs.SoundJS.INTERUPT_LATE, 0, 0.8);
}
}
}
@@ -354,7 +352,7 @@
o.graphics.beginStroke("#FFFFFF").moveTo(-1, 0).lineTo(1, 0);
// play the shot sound
- SoundJS.play("laser", SoundJS.INTERUPT_LATE);
+ createjs.SoundJS.play("laser", createjs.SoundJS.INTERUPT_LATE);
}
function getSpaceRock(size) {
@@ -389,7 +387,7 @@
//pooling approach
while(i <= len){
if(!bulletStream[i]) {
- bulletStream[i] = new Shape();
+ bulletStream[i] = new createjs.Shape();
break;
} else if(!bulletStream[i].active) {
bulletStream[i].active = true;
@@ -400,7 +398,7 @@
}
if(len == 0) {
- bulletStream[0] = new Shape();
+ bulletStream[0] = new createjs.Shape();
}
stage.addChild(bulletStream[i]);
View
19 examples/MediaPlayer.html
@@ -3,7 +3,7 @@
<head>
<title>SoundJS: Media Player Example</title>
- <script type="text/javascript" src="http://code.createjs.com/preloadjs-0.1.0.min.js"></script>
+ <script type="text/javascript" src="./assets/preloadjs-NEXT.min.js"></script>
<script type="text/javascript" src="../src/soundjs/SoundJS.js"></script>
<script type="text/javascript" src="../src/soundjs/HTMLAudioPlugin.js"></script>
@@ -24,8 +24,8 @@
document.getElementById("header").style.display = "none";
}
- SoundJS.FlashPlugin.BASE_PATH = "assets/" // Initialize the base path from this document to the Flash Plugin
- if (!SoundJS.checkPlugin(true)) {
+ createjs.FlashPlugin.BASE_PATH = "../src/soundjs/" // Initialize the base path from this document to the Flash Plugin
+ if (!createjs.SoundJS.checkPlugin(true)) {
document.getElementById("error").style.display = "block";
document.getElementById("content").style.display = "none";
return;
@@ -42,17 +42,17 @@
{src:assetPath+"M-GameBG.mp3|"+assetPath+"M-GameBG.ogg", id:"music"}
];
- preload = new PreloadJS();
+ preload = new createjs.PreloadJS();
preload.onProgress = handleProgress;
preload.onComplete = handleLoadComplete;
- preload.installPlugin(SoundJS);
+ preload.installPlugin(createjs.SoundJS);
preload.loadManifest(manifest);
$("#loading").text("Loading...")
}
function stop() {
if (preload != null) { preload.cancel(); }
- SoundJS.stop();
+ createjs.SoundJS.stop();
//$("#position").css("display", "none");
//$("#playPauseBtn").attr("disabled", true);
@@ -76,7 +76,7 @@
//$("#progress").css("display", "none");
//$("#position").css("display", "block");
- instance = SoundJS.play("music");
+ instance = createjs.SoundJS.play("music");
instance.onComplete = function() {
clearInterval(positionInterval);
$("#playBtn").removeClass("pauseBtn").addClass("playBtn")
@@ -85,7 +85,7 @@
//$("#playPauseBtn").attr("disabled", false);
$("#playBtn").removeClass("playBtn").addClass("pauseBtn");
$("#playBtn").click(function(event){
- if (instance.playState == SoundJS.PLAY_FINISHED) {
+ if (instance.playState == createjs.SoundJS.PLAY_FINISHED) {
instance.play();
$("#playBtn").removeClass("playBtn").addClass("pauseBtn");
trackTime();
@@ -126,7 +126,8 @@
});
});
}
-var dragOffset;
+
+ var dragOffset;
function trackTime() {
positionInterval = setInterval(function(event) {
if(seeking) { return; };
View
16 examples/PreloadAndPlay.html
@@ -3,7 +3,7 @@
<head>
<title>SoundJS: Preload & Sound APIs</title>
- <script type="text/javascript" src="http://code.createjs.com/preloadjs-0.1.0.min.js"></script>
+ <script type="text/javascript" src="./assets/preloadjs-NEXT.min.js"></script>
<script type="text/javascript" src="../src/soundjs/SoundJS.js"></script>
<script type="text/javascript" src="../src/soundjs/HTMLAudioPlugin.js"></script>
@@ -22,8 +22,8 @@
document.getElementById("header").style.display = "none";
}
- SoundJS.FlashPlugin.BASE_PATH = "assets/" // Initialize the base path from this document to the Flash Plugin
- if (!SoundJS.checkPlugin(true)) {
+ createjs.FlashPlugin.BASE_PATH = "../src/soundjs/" // Initialize the base path from this document to the Flash Plugin
+ if (!createjs.SoundJS.checkPlugin(true)) {
document.getElementById("error").style.display = "block";
document.getElementById("content").style.display = "none";
return;
@@ -35,11 +35,9 @@
var assetsPath = "assets/";
var item = {src:assetsPath+"18-machinae_supremacy-lord_krutors_dominion.mp3|"+assetsPath+"18-machinae_supremacy-lord_krutors_dominion.ogg", id:"music"};
- SoundJS.FlashPlugin.BASE_PATH = "assets/" // Initialize the base path from this document to the Flash Plugin
-
// Instantiate a queue.
- queue = new PreloadJS();
- queue.installPlugin(SoundJS); // Plug in SoundJS to handle browser-specific paths
+ queue = new createjs.PreloadJS();
+ queue.installPlugin(createjs.SoundJS); // Plug in SoundJS to handle browser-specific paths
queue.onComplete = loadComplete;
queue.onFileError = handleFileError;
queue.onProgress = handleProgress;
@@ -48,7 +46,7 @@
function stop() {
if (queue != null) { queue.cancel(); }
- SoundJS.stop();
+ createjs.SoundJS.stop();
}
function handleFileError(o) {
@@ -69,7 +67,7 @@
function playSound(name, loop) {
// Play the sound using the ID created above.
- return SoundJS.play(name);
+ return createjs.SoundJS.play(name);
}
</script>
View
16 examples/SoundGrid.html
@@ -3,7 +3,7 @@
<head>
<title>SoundJS: Sound Grid</title>
- <script src="http://code.createjs.com/preloadjs-0.1.0.min.js"></script>
+ <script src="./assets/preloadjs-NEXT.min.js"></script>
<script type="text/javascript" src="../src/soundjs/SoundJS.js"></script>
<script type="text/javascript" src="../src/soundjs/HTMLAudioPlugin.js"></script>
@@ -21,8 +21,8 @@
document.getElementById("header").style.display = "none";
}
- SoundJS.FlashPlugin.BASE_PATH = "assets/" // Initialize the base path from this document to the Flash Plugin
- if (!SoundJS.checkPlugin(true)) {
+ createjs.FlashPlugin.BASE_PATH = "../src/soundjs/" // Initialize the base path from this document to the Flash Plugin
+ if (!createjs.SoundJS.checkPlugin(true)) {
document.getElementById("error").style.display = "block";
document.getElementById("content").style.display = "none";
return;
@@ -48,9 +48,9 @@
{src:assetsPath+"Game-Break.mp3|"+assetsPath+"Game-Break.ogg", id:12, data: 1}
];
- preload = new PreloadJS();
+ preload = new createjs.PreloadJS();
//Install SoundJS as a plugin, then PreloadJS will initialize it automatically.
- preload.installPlugin(SoundJS);
+ preload.installPlugin(createjs.SoundJS);
//Available PreloadJS callbacks
preload.onFileLoad = function(event) {
@@ -68,13 +68,13 @@
function stop() {
if (preload != null) { preload.close(); }
- SoundJS.stop();
+ createjs.SoundJS.stop();
}
function playSound(target) {
//Play the sound: play (src, interrupt, delay, offset, loop, volume, pan)
- var instance = SoundJS.play(target.id, SoundJS.INTERRUPT_NONE, 0, 0, false, 1);
- if (instance == null) { return; }
+ var instance = createjs.SoundJS.play(target.id, createjs.SoundJS.INTERRUPT_NONE, 0, 0, false, 1);
+ if (instance == null || instance.playState == createjs.SoundJS.PLAY_FAILED) { return; }
target.className = "gridBox active";
instance.onComplete = function(instance) {
target.className = "gridBox";
View
24 examples/TestSuite.html
@@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>SoundJS: Test Suite</title>
- <script src="http://code.createjs.com/preloadjs-0.1.0.min.js"></script>
+ <script src="./assets/preloadjs-NEXT.min.js"></script>
<script type="text/javascript" src="../src/soundjs/SoundJS.js"></script>
<script type="text/javascript" src="../src/soundjs/HTMLAudioPlugin.js"></script>
@@ -33,13 +33,13 @@
document.getElementById("header").style.display = "none";
}
- SoundJS.FlashPlugin.BASE_PATH = "assets/" // Initialize the base path from this document to the Flash Plugin
+ createjs.FlashPlugin.BASE_PATH = "../src/soundjs/" // Initialize the base path from this document to the Flash Plugin
if (params.type == "flash") {
- SoundJS.registerPlugins([SoundJS.FlashPlugin]);
+ createjs.SoundJS.registerPlugins([createjs.FlashPlugin]);
} else {
- SoundJS.registerPlugins([SoundJS.HTMLAudioPlugin, SoundJS.FlashPlugin]);
+ createjs.SoundJS.registerPlugins([createjs.HTMLAudioPlugin, createjs.FlashPlugin]);
}
- if (!SoundJS.checkPlugin(true)) {
+ if (!createjs.SoundJS.checkPlugin(true)) {
document.getElementById("error").style.display = "block";
document.getElementById("content").style.display = "none";
return;
@@ -91,8 +91,8 @@
change:handleSliderChange
});
- preload = new PreloadJS();
- preload.installPlugin(SoundJS);
+ preload = new createjs.PreloadJS();
+ preload.installPlugin(createjs.SoundJS);
preload.onFileLoad = handleFileLoad;
preload.onProgress = handleProgress;
preload.onComplete = handleComplete;
@@ -115,13 +115,13 @@
$("#library").change(selectItem);
$("#playSoundBtn").click(playSound);
$("#stopAllSoundsBtn").click(function(event) {
- SoundJS.stop();
+ createjs.SoundJS.stop();
removeSound("all");
});
$(".masterVolumeSlider").slider().bind('slide',function(event){
var value = $(this).slider("option", "value");
- SoundJS.setVolume(value/100);
+ createjs.SoundJS.setVolume(value/100);
});
// Instance Controls
@@ -155,7 +155,7 @@
function stop() {
if (preload != null) { preload.close(); }
- SoundJS.stop();
+ createjs.SoundJS.stop();
}
function handleSliderChange() {
@@ -200,7 +200,7 @@
var item = list.options[index];
// Play Sound
- var instance = SoundJS.play(item.value, interruptValue, delay, offset, loop, 1, 0);
+ var instance = createjs.SoundJS.play(item.value, interruptValue, delay, offset, loop, 1, 0);
if (instance == null) { continue; }
instance.onPlayFailed = handlePlayFailed;
instance.onComplete = handleSoundComplete;
@@ -264,7 +264,7 @@
var list = $("#nowPlaying").get(0);
var item = list.options[list.selectedIndex];
- var instance = SoundJS.getInstanceById(item.value);
+ var instance = createjs.SoundJS.getInstanceById(item.value);
if (instance == null) { return null; }
return instance;
}
View
BIN examples/assets/FlashAudioPlugin.swf
Binary file not shown.
View
129 examples/assets/Ship.js
@@ -1,128 +1 @@
-(function(window) {
-
-
-
-//
-
-function Ship() {
-
- this.initialize();
-
-}
-
-var p = Ship.prototype = new Container();
-
-
-
-// public properties:
-
- Ship.TOGGLE = 60;
-
- Ship.MAX_THRUST = 2;
-
- Ship.MAX_VELOCITY = 5;
-
-
-
-// public properties:
-
- p.shipFlame;
-
- p.shipBody;
-
-
-
- p.timeout;
-
- p.thrust;
-
-
-
- p.vX;
-
- p.vY;
-
-
-
- p.bounds;
-
- p.hit;
-
-
-
-// constructor:
-
- p.Container_initialize = p.initialize; //unique to avoid overiding base class
-
-
-
- p.initialize = function() {
-
- this.Container_initialize();
-
-
-
- this.shipFlame = new Shape();
-
- this.shipBody = new Shape();
-
-
-
- this.addChild(this.shipFlame);
-
- this.addChild(this.shipBody);
-
-
-
- this.makeShape();
-
- this.timeout = 0;
-
- this.thrust = 0;
-
- this.vX = 0;
-
- this.vY = 0;
-
- }
-
-
-
-// public methods:
-
- p.makeShape = function() {
-
- //draw ship body
-
- var g = this.shipBody.graphics;
-
- g.clear();
-
- g.beginStroke("#FFFFFF");
-
-
-
- g.moveTo(0, 10); //nose
-
- g.lineTo(5, -6); //rfin
-
- g.lineTo(0, -2); //notch
-
- g.lineTo(-5, -6); //lfin
-
- g.closePath(); // nose
-
-
-
-
-
- //draw ship flame
-
- var o = this.shipFlame;
-
- o.scaleX = 0.5;
-
- o.scaleY = 0.5;
-
- o.y = -5;
-
+(function(window) {
View
140 examples/assets/SpaceRock.js
@@ -1,139 +1 @@
-(function(window) {
-
-
-
-//
-
-function SpaceRock(size) {
-
- this.initialize(size);
-
-}
-
-
-
-var p = SpaceRock.prototype = new Shape();
-
-
-
-// static properties:
-
- SpaceRock.LRG_ROCK = 40;
-
- SpaceRock.MED_ROCK = 20;
-
- SpaceRock.SML_ROCK = 10;
-
-
-
-// public properties:
-
-
-
- p.bounds; //visual radial size
-
- p.hit; //average radial disparity
-
-
-
- p.size; //size value itself
-
- p.spin; //spin ammount
-
- p.score; //score value
-
-
-
- p.vX; //velocity X
-
- p.vY; //velocity Y
-
-
-
- p.active; //is it active
-
-
-
-// constructor:
-
- p.Shape_initialize = p.initialize; //unique to avoid overiding base class
-
-
-
- p.initialize = function(size) {
-
- this.Shape_initialize(); // super call
-
-
-
- this.activate(size);
-
- }
-
-
-
-// public methods:
-
- //handle drawing a spaceRock
-
- p.getShape = function(size) {
-
- var angle = 0;
-
- var radius = size;
-
-
-
- this.size = size;
-
- this.hit = size;
-
- this.bounds = 0;
-
-
-
- //setup
-
- this.graphics.clear();
-
- this.graphics.beginStroke("#FFFFFF");
-
-
-
- this.graphics.moveTo(0, size);
-
- //draw spaceRock
-
- while(angle < (Math.PI*2 - .5)) {
-
- angle += .25+(Math.random()*100)/500;
-
- radius = size+(size/2*Math.random());
-
- this.graphics.lineTo(Math.sin(angle)*radius, Math.cos(angle)*radius);
-
-
-
- //track visual depiction for interaction
-
- if(radius > this.bounds) { this.bounds = radius; } //furthest point
-
- this.hit = (this.hit + radius) / 2; //running average
-
- }
-
-
-
- this.graphics.closePath(); // draw the last line segment back to the start point.
-
- this.hit *= 1.1; //pad a bit
-
- }
-
-
-
- //handle reinit for poolings sake
-
- p.activate = function(size) {
-
- this.getShape(size);
+(function(window) {
View
BIN examples/assets/demo-convolution.png
Deleted file not rendered
View
BIN examples/assets/demo-game.png
Deleted file not rendered
View
BIN examples/assets/demo-mediaPlayer.png
Deleted file not rendered
View
BIN examples/assets/demo-soundGrid.png
Deleted file not rendered
View
BIN examples/assets/demo-testSuite.png
Deleted file not rendered
View
103 examples/assets/easeljs-NEXT.min.js
@@ -0,0 +1,103 @@
+/*
+* 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(){throw"UID cannot be instantiated";};c._nextID=0;c.get=function(){return c._nextID++};g.UID=c})(createjs||(createjs={}));var createjs;(function(g){var c=function(){throw"Ticker cannot be instantiated.";};c.useRAF=null;c._listeners=null;c._pauseable=null;c._paused=false;c._inited=false;c._startTime=0;c._pausedTime=0;c._ticks=0;c._pausedTicks=0;c._interval=50;c._lastTime=0;c._times=null;c._tickTimes=null;c._rafActive=false;c._timeoutID=null;c.addListener=function(a,i){a!=null&&(c._inited||c.init(),c.removeListener(a),c._pauseable[c._listeners.length]=i==null?true:i,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._pausedTicks:0)};c._handleAF=function(){c._rafActive=false;c._setupTick();c._getTime()-c._lastTime>=(c._interval-1)*0.97&&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=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(a){a(c._handleAF);c._rafActive=true;return}}c.timeoutID=setTimeout(c._handleTimeout,c._interval)}};c._tick=function(){var a=c._getTime();c._ticks++;var i=a-c._lastTime,b=c._paused;b&&(c._pausedTicks++,
+c._pausedTime+=i);c._lastTime=a;for(var d=c._pauseable,e=c._listeners.slice(),f=e?e.length:0,h=0;h<f;h++){var j=e[h];j==null||b&&d[h]||(j.tick?j.tick(i,b):j instanceof Function&&j(i,b))}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()};var b=window.performance&&(performance.now||performance.mozNow||performance.msNow||performance.oNow||performance.webkitNow);c._getTime=function(){return b&&b.call(performance)||
+(new Date).getTime()};g.Ticker=c})(createjs||(createjs={}));(function(g){var c=function(a,i,b,d,c,f,h,j,k){this.initialize(a,i,b,d,c,f,h,j,k)},b=c.prototype;b.stageX=0;b.stageY=0;b.rawX=0;b.rawY=0;b.type=null;b.nativeEvent=null;b.onMouseMove=null;b.onMouseUp=null;b.target=null;b.pointerID=0;b.primary=false;b.initialize=function(a,i,b,d,c,f,h,j,k){this.type=a;this.stageX=i;this.stageY=b;this.target=d;this.nativeEvent=c;this.pointerID=f;this.primary=h;this.rawX=j==null?i:j;this.rawY=k==null?b:k};b.clone=function(){return new c(this.type,this.stageX,this.stageY,
+this.target,this.nativeEvent,this.pointerID,this.primary,this.rawX,this.rawY)};b.toString=function(){return"[MouseEvent (type="+this.type+" stageX="+this.stageX+" stageY="+this.stageY+")]"};g.MouseEvent=c})(createjs||(createjs={}));(function(g){var c=function(a,i,b,d,c,f){this.initialize(a,i,b,d,c,f)},b=c.prototype;c.identity=null;c.DEG_TO_RAD=Math.PI/180;b.a=1;b.b=0;b.c=0;b.d=1;b.tx=0;b.ty=0;b.alpha=1;b.shadow=null;b.compositeOperation=null;b.initialize=function(a,i,b,d,c,f){if(a!=null)this.a=a;this.b=i||0;this.c=b||0;if(d!=null)this.d=d;this.tx=c||0;this.ty=f||0;return this};b.prepend=function(a,i,b,d,c,f){var h=this.tx;if(a!=1||i!=0||b!=0||d!=1){var j=this.a,k=this.c;this.a=j*a+this.b*b;this.b=j*i+this.b*d;this.c=k*a+this.d*
+b;this.d=k*i+this.d*d}this.tx=h*a+this.ty*b+c;this.ty=h*i+this.ty*d+f;return this};b.append=function(a,i,b,d,c,f){var h=this.a,j=this.b,k=this.c,l=this.d;this.a=a*h+i*k;this.b=a*j+i*l;this.c=b*h+d*k;this.d=b*j+d*l;this.tx=c*h+f*k+this.tx;this.ty=c*j+f*l+this.ty;return this};b.prependMatrix=function(a){this.prepend(a.a,a.b,a.c,a.d,a.tx,a.ty);this.prependProperties(a.alpha,a.shadow,a.compositeOperation);return this};b.appendMatrix=function(a){this.append(a.a,a.b,a.c,a.d,a.tx,a.ty);this.appendProperties(a.alpha,
+a.shadow,a.compositeOperation);return this};b.prependTransform=function(a,i,b,d,e,f,h,j,k){if(e%360)var l=e*c.DEG_TO_RAD,e=Math.cos(l),l=Math.sin(l);else e=1,l=0;if(j||k)this.tx-=j,this.ty-=k;f||h?(f*=c.DEG_TO_RAD,h*=c.DEG_TO_RAD,this.prepend(e*b,l*b,-l*d,e*d,0,0),this.prepend(Math.cos(h),Math.sin(h),-Math.sin(f),Math.cos(f),a,i)):this.prepend(e*b,l*b,-l*d,e*d,a,i);return this};b.appendTransform=function(a,i,b,d,e,f,h,j,k){if(e%360)var l=e*c.DEG_TO_RAD,e=Math.cos(l),l=Math.sin(l);else e=1,l=0;f||
+h?(f*=c.DEG_TO_RAD,h*=c.DEG_TO_RAD,this.append(Math.cos(h),Math.sin(h),-Math.sin(f),Math.cos(f),a,i),this.append(e*b,l*b,-l*d,e*d,0,0)):this.append(e*b,l*b,-l*d,e*d,a,i);if(j||k)this.tx-=j*this.a+k*this.c,this.ty-=j*this.b+k*this.d;return this};b.rotate=function(a){var i=Math.cos(a),a=Math.sin(a),b=this.a,d=this.c,c=this.tx;this.a=b*i-this.b*a;this.b=b*a+this.b*i;this.c=d*i-this.d*a;this.d=d*a+this.d*i;this.tx=c*i-this.ty*a;this.ty=c*a+this.ty*i;return this};b.skew=function(a,i){a*=c.DEG_TO_RAD;i*=
+c.DEG_TO_RAD;this.append(Math.cos(i),Math.sin(i),-Math.sin(a),Math.cos(a),0,0);return this};b.scale=function(a,i){this.a*=a;this.d*=i;this.tx*=a;this.ty*=i;return this};b.translate=function(a,i){this.tx+=a;this.ty+=i;return this};b.identity=function(){this.alpha=this.a=this.d=1;this.b=this.c=this.tx=this.ty=0;this.shadow=this.compositeOperation=null;return this};b.invert=function(){var a=this.a,i=this.b,b=this.c,c=this.d,e=this.tx,f=a*c-i*b;this.a=c/f;this.b=-i/f;this.c=-b/f;this.d=a/f;this.tx=(b*
+this.ty-c*e)/f;this.ty=-(a*this.ty-i*e)/f;return this};b.isIdentity=function(){return this.tx==0&&this.ty==0&&this.a==1&&this.b==0&&this.c==0&&this.d==1};b.decompose=function(a){a==null&&(a={});a.x=this.tx;a.y=this.ty;a.scaleX=Math.sqrt(this.a*this.a+this.b*this.b);a.scaleY=Math.sqrt(this.c*this.c+this.d*this.d);var i=Math.atan2(-this.c,this.d),b=Math.atan2(this.b,this.a);i==b?(a.rotation=b/c.DEG_TO_RAD,this.a<0&&this.d>=0&&(a.rotation+=a.rotation<=0?180:-180),a.skewX=a.skewY=0):(a.skewX=i/c.DEG_TO_RAD,
+a.skewY=b/c.DEG_TO_RAD);return a};b.reinitialize=function(a,i,b,c,e,f,h,j,k){this.initialize(a,i,b,c,e,f);this.alpha=h||1;this.shadow=j;this.compositeOperation=k;return this};b.appendProperties=function(a,i,b){this.alpha*=a;this.shadow=i||this.shadow;this.compositeOperation=b||this.compositeOperation;return this};b.prependProperties=function(a,i,b){this.alpha*=a;this.shadow=this.shadow||i;this.compositeOperation=this.compositeOperation||b;return this};b.clone=function(){var a=new c(this.a,this.b,
+this.c,this.d,this.tx,this.ty);a.shadow=this.shadow;a.alpha=this.alpha;a.compositeOperation=this.compositeOperation;return a};b.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);g.Matrix2D=c})(createjs||(createjs={}));(function(g){var c=function(a,i){this.initialize(a,i)},b=c.prototype;b.x=0;b.y=0;b.initialize=function(a,i){this.x=a==null?0:a;this.y=i==null?0:i};b.clone=function(){return new c(this.x,this.y)};b.toString=function(){return"[Point (x="+this.x+" y="+this.y+")]"};g.Point=c})(createjs||(createjs={}));(function(g){var c=function(a,i,b,c){this.initialize(a,i,b,c)},b=c.prototype;b.x=0;b.y=0;b.width=0;b.height=0;b.initialize=function(a,i,b,c){this.x=a==null?0:a;this.y=i==null?0:i;this.width=b==null?0:b;this.height=c==null?0:c};b.clone=function(){return new c(this.x,this.y,this.width,this.height)};b.toString=function(){return"[Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")]"};g.Rectangle=c})(createjs||(createjs={}));(function(g){var c=function(a,i,b,c){this.initialize(a,i,b,c)},b=c.prototype;c.identity=null;b.color=null;b.offsetX=0;b.offsetY=0;b.blur=0;b.initialize=function(a,i,b,c){this.color=a;this.offsetX=i;this.offsetY=b;this.blur=c};b.toString=function(){return"[Shadow]"};b.clone=function(){return new c(this.color,this.offsetX,this.offsetY,this.blur)};c.identity=new c("transparent",0,0,0);g.Shadow=c})(createjs||(createjs={}));(function(g){var c=function(a){this.initialize(a)},b=c.prototype;b.complete=true;b.onComplete=null;b._animations=null;b._frames=null;b._images=null;b._data=null;b._loadCount=0;b._frameHeight=0;b._frameWidth=0;b._numFrames=0;b._regX=0;b._regY=0;b.initialize=function(a){var i,b,c;if(a!=null){if(a.images&&(b=a.images.length)>0){c=this._images=[];for(i=0;i<b;i++){var e=a.images[i];if(typeof e=="string"){var f=e,e=new Image;e.src=f}c.push(e);if(!e.getContext&&!e.complete)this._loadCount++,this.complete=
+false,function(a){e.onload=function(){a._handleImageLoad()}}(this)}}if(a.frames!=null)if(a.frames instanceof Array){this._frames=[];c=a.frames;for(i=0,b=c.length;i<b;i++)f=c[i],this._frames.push({image:this._images[f[4]?f[4]:0],rect:new g.Rectangle(f[0],f[1],f[2],f[3]),regX:f[5]||0,regY:f[6]||0})}else b=a.frames,this._frameWidth=b.width,this._frameHeight=b.height,this._regX=b.regX||0,this._regY=b.regY||0,this._numFrames=b.count,this._loadCount==0&&this._calculateFrames();if((b=a.animations)!=null){this._animations=
+[];this._data={};for(var h in b){a={name:h};f=b[h];if(isNaN(f))if(f instanceof Array){a.frequency=f[3];a.next=f[2];c=a.frames=[];for(i=f[0];i<=f[1];i++)c.push(i)}else a.frequency=f.frequency,a.next=f.next,i=f.frames,c=a.frames=!isNaN(i)?[i]:i.slice(0);else c=a.frames=[f];a.next=c.length<2||a.next==false?null:a.next==null||a.next==true?h:a.next;if(!a.frequency)a.frequency=1;this._animations.push(h);this._data[h]=a}}}};b.getNumFrames=function(a){return a==null?this._frames?this._frames.length:this._numFrames:
+(a=this._data[a],a==null?0:a.frames.length)};b.getAnimations=function(){return this._animations.slice(0)};b.getAnimation=function(a){return this._data[a]};b.getFrame=function(a){return this.complete&&this._frames&&(frame=this._frames[a])?frame:null};b.toString=function(){return"[SpriteSheet]"};b.clone=function(){var a=new c;a.complete=this.complete;a._animations=this._animations;a._frames=this._frames;a._images=this._images;a._data=this._data;a._frameHeight=this._frameHeight;a._frameWidth=this._frameWidth;
+a._numFrames=this._numFrames;a._loadCount=this._loadCount;return a};b._handleImageLoad=function(){if(--this._loadCount==0)this._calculateFrames(),this.complete=true,this.onComplete&&this.onComplete()};b._calculateFrames=function(){if(!(this._frames||this._frameWidth==0)){this._frames=[];for(var a=0,b=this._frameWidth,c=this._frameHeight,d=0,e=this._images;d<e.length;d++){for(var f=e[d],h=(f.width+1)/b|0,j=(f.height+1)/c|0,j=this._numFrames>0?Math.min(this._numFrames-a,h*j):h*j,k=0;k<j;k++)this._frames.push({image:f,
+rect:new g.Rectangle(k%h*b,(k/h|0)*c,b,c),regX:this._regX,regY:this._regY});a+=j}this._numFrames=a}};g.SpriteSheet=c})(createjs||(createjs={}));(function(g){function c(a,b,c){this.f=a;this.params=b;this.path=c==null?true:c}c.prototype.exec=function(a){this.f.apply(a,this.params)};var b=function(){this.initialize()},a=b.prototype;b.getRGB=function(a,b,c,e){a!=null&&c==null&&(e=b,c=a&255,b=a>>8&255,a=a>>16&255);return e==null?"rgb("+a+","+b+","+c+")":"rgba("+a+","+b+","+c+","+e+")"};b.getHSL=function(a,b,c,e){return e==null?"hsl("+a%360+","+b+"%,"+c+"%)":"hsla("+a%360+","+b+"%,"+c+"%,"+e+")"};b.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};b.STROKE_CAPS_MAP=["butt","round","square"];b.STROKE_JOINTS_MAP=["miter","round","bevel"];b._ctx=document.createElement("canvas").getContext("2d");b.beginCmd=new c(b._ctx.beginPath,[],false);b.fillCmd=new c(b._ctx.fill,[],
+false);b.strokeCmd=new c(b._ctx.stroke,[],false);a._strokeInstructions=null;a._strokeStyleInstructions=null;a._fillInstructions=null;a._instructions=null;a._oldInstructions=null;a._activeInstructions=null;a._active=false;a._dirty=false;a.initialize=function(){this.clear();this._ctx=b._ctx};a.draw=function(a){this._dirty&&this._updateInstructions();for(var b=this._instructions,c=0,e=b.length;c<e;c++)b[c].exec(a)};a.drawAsPath=function(a){this._dirty&&this._updateInstructions();for(var b,c=this._instructions,
+e=0,f=c.length;e<f;e++)((b=c[e]).path||e==0)&&b.exec(a)};a.moveTo=function(a,b){this._activeInstructions.push(new c(this._ctx.moveTo,[a,b]));return this};a.lineTo=function(a,b){this._dirty=this._active=true;this._activeInstructions.push(new c(this._ctx.lineTo,[a,b]));return this};a.arcTo=function(a,b,d,e,f){this._dirty=this._active=true;this._activeInstructions.push(new c(this._ctx.arcTo,[a,b,d,e,f]));return this};a.arc=function(a,b,d,e,f,h){this._dirty=this._active=true;h==null&&(h=false);this._activeInstructions.push(new c(this._ctx.arc,
+[a,b,d,e,f,h]));return this};a.quadraticCurveTo=function(a,b,d,e){this._dirty=this._active=true;this._activeInstructions.push(new c(this._ctx.quadraticCurveTo,[a,b,d,e]));return this};a.bezierCurveTo=function(a,b,d,e,f,h){this._dirty=this._active=true;this._activeInstructions.push(new c(this._ctx.bezierCurveTo,[a,b,d,e,f,h]));return this};a.rect=function(a,b,d,e){this._dirty=this._active=true;this._activeInstructions.push(new c(this._ctx.rect,[a,b,d,e]));return this};a.closePath=function(){if(this._active)this._dirty=
+true,this._activeInstructions.push(new c(this._ctx.closePath,[]));return this};a.clear=function(){this._instructions=[];this._oldInstructions=[];this._activeInstructions=[];this._strokeStyleInstructions=this._strokeInstructions=this._fillInstructions=null;this._active=this._dirty=false;return this};a.beginFill=function(a){this._active&&this._newPath();this._fillInstructions=a?[new c(this._setProp,["fillStyle",a],false)]:null;return this};a.beginLinearGradientFill=function(a,b,d,e,f,h){this._active&&
+this._newPath();d=this._ctx.createLinearGradient(d,e,f,h);e=0;for(f=a.length;e<f;e++)d.addColorStop(b[e],a[e]);this._fillInstructions=[new c(this._setProp,["fillStyle",d],false)];return this};a.beginRadialGradientFill=function(a,b,d,e,f,h,j,k){this._active&&this._newPath();d=this._ctx.createRadialGradient(d,e,f,h,j,k);e=0;for(f=a.length;e<f;e++)d.addColorStop(b[e],a[e]);this._fillInstructions=[new c(this._setProp,["fillStyle",d],false)];return this};a.beginBitmapFill=function(a,b){this._active&&this._newPath();
+var d=this._ctx.createPattern(a,b||"");this._fillInstructions=[new c(this._setProp,["fillStyle",d],false)];return this};a.endFill=function(){return this.beginFill()};a.setStrokeStyle=function(a,n,d,e){this._active&&this._newPath();this._strokeStyleInstructions=[new c(this._setProp,["lineWidth",a==null?"1":a],false),new c(this._setProp,["lineCap",n==null?"butt":isNaN(n)?n:b.STROKE_CAPS_MAP[n]],false),new c(this._setProp,["lineJoin",d==null?"miter":isNaN(d)?d:b.STROKE_JOINTS_MAP[d]],false),new c(this._setProp,
+["miterLimit",e==null?"10":e],false)];return this};a.beginStroke=function(a){this._active&&this._newPath();this._strokeInstructions=a?[new c(this._setProp,["strokeStyle",a],false)]:null;return this};a.beginLinearGradientStroke=function(a,b,d,e,f,h){this._active&&this._newPath();d=this._ctx.createLinearGradient(d,e,f,h);e=0;for(f=a.length;e<f;e++)d.addColorStop(b[e],a[e]);this._strokeInstructions=[new c(this._setProp,["strokeStyle",d],false)];return this};a.beginRadialGradientStroke=function(a,b,d,
+e,f,h,j,k){this._active&&this._newPath();d=this._ctx.createRadialGradient(d,e,f,h,j,k);e=0;for(f=a.length;e<f;e++)d.addColorStop(b[e],a[e]);this._strokeInstructions=[new c(this._setProp,["strokeStyle",d],false)];return this};a.beginBitmapStroke=function(a,b){this._active&&this._newPath();var d=this._ctx.createPattern(a,b||"");this._strokeInstructions=[new c(this._setProp,["strokeStyle",d],false)];return this};a.endStroke=function(){this.beginStroke();return this};a.curveTo=a.quadraticCurveTo;a.drawRect=
+a.rect;a.drawRoundRect=function(a,b,c,e,f){this.drawRoundRectComplex(a,b,c,e,f,f,f,f);return this};a.drawRoundRectComplex=function(a,b,d,e,f,h,j,k){var l=(d<e?d:e)/2,g=0,m=0,q=0,r=0;f<0&&(f*=g=-1);f>l&&(f=l);h<0&&(h*=m=-1);h>l&&(h=l);j<0&&(j*=q=-1);j>l&&(j=l);k<0&&(k*=r=-1);k>l&&(k=l);this._dirty=this._active=true;var l=this._ctx.arcTo,p=this._ctx.lineTo;this._activeInstructions.push(new c(this._ctx.moveTo,[a+d-h,b]),new c(l,[a+d+h*m,b-h*m,a+d,b+h,h]),new c(p,[a+d,b+e-j]),new c(l,[a+d+j*q,b+e+j*q,
+a+d-j,b+e,j]),new c(p,[a+k,b+e]),new c(l,[a-k*r,b+e+k*r,a,b+e-k,k]),new c(p,[a,b+f]),new c(l,[a-f*g,b-f*g,a+f,b,f]),new c(this._ctx.closePath));return this};a.drawCircle=function(a,b,c){this.arc(a,b,c,0,Math.PI*2);return this};a.drawEllipse=function(a,b,d,e){this._dirty=this._active=true;var f=d/2*0.5522848,h=e/2*0.5522848,j=a+d,k=b+e,d=a+d/2,e=b+e/2;this._activeInstructions.push(new c(this._ctx.moveTo,[a,e]),new c(this._ctx.bezierCurveTo,[a,e-h,d-f,b,d,b]),new c(this._ctx.bezierCurveTo,[d+f,b,j,
+e-h,j,e]),new c(this._ctx.bezierCurveTo,[j,e+h,d+f,k,d,k]),new c(this._ctx.bezierCurveTo,[d-f,k,a,e+h,a,e]));return this};a.drawPolyStar=function(a,b,d,e,f,h){this._dirty=this._active=true;f==null&&(f=0);f=1-f;h==null?h=0:h/=180/Math.PI;var j=Math.PI/e;this._activeInstructions.push(new c(this._ctx.moveTo,[a+Math.cos(h)*d,b+Math.sin(h)*d]));for(var k=0;k<e;k++)h+=j,f!=1&&this._activeInstructions.push(new c(this._ctx.lineTo,[a+Math.cos(h)*d*f,b+Math.sin(h)*d*f])),h+=j,this._activeInstructions.push(new c(this._ctx.lineTo,
+[a+Math.cos(h)*d,b+Math.sin(h)*d]));return this};a.decodePath=function(a){for(var c=[this.moveTo,this.lineTo,this.quadraticCurveTo,this.bezierCurveTo],d=[2,2,4,6],e=0,f=a.length,h=[],j=0,k=0,l=b.BASE_64;e<f;){var g=l[a.charAt(e)],m=g>>3,q=c[m];if(!q||g&3)throw"bad path data";var r=d[m];m||(j=k=0);h.length=0;e++;g=(g>>2&1)+2;for(m=0;m<r;m++){var p=l[a.charAt(e)],s=p>>5?-1:1,p=(p&31)<<6|l[a.charAt(e+1)];g==3&&(p=p<<6|l[a.charAt(e+2)]);p=s*p/10;m%2?j=p+=j:k=p+=k;h[m]=p;e+=g}q.apply(this,h)}return this};
+a.clone=function(){var a=new b;a._instructions=this._instructions.slice();a._activeInstructions=this._activeInstructions.slice();a._oldInstructions=this._oldInstructions.slice();if(this._fillInstructions)a._fillInstructions=this._fillInstructions.slice();if(this._strokeInstructions)a._strokeInstructions=this._strokeInstructions.slice();if(this._strokeStyleInstructions)a._strokeStyleInstructions=this._strokeStyleInstructions.slice();a._active=this._active;a._dirty=this._dirty;a.drawAsPath=this.drawAsPath;
+return a};a.toString=function(){return"[Graphics]"};a.mt=a.moveTo;a.lt=a.lineTo;a.at=a.arcTo;a.bt=a.bezierCurveTo;a.qt=a.quadraticCurveTo;a.a=a.arc;a.r=a.rect;a.cp=a.closePath;a.c=a.clear;a.f=a.beginFill;a.lf=a.beginLinearGradientFill;a.rf=a.beginRadialGradientFill;a.bf=a.beginBitmapFill;a.ef=a.endFill;a.ss=a.setStrokeStyle;a.s=a.beginStroke;a.ls=a.beginLinearGradientStroke;a.rs=a.beginRadialGradientStroke;a.bs=a.beginBitmapStroke;a.es=a.endStroke;a.dr=a.drawRect;a.rr=a.drawRoundRect;a.rc=a.drawRoundRectComplex;
+a.dc=a.drawCircle;a.de=a.drawEllipse;a.dp=a.drawPolyStar;a.p=a.decodePath;a._updateInstructions=function(){this._instructions=this._oldInstructions.slice();this._instructions.push(b.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(b.fillCmd);this._strokeInstructions&&this._instructions.push(b.strokeCmd)};a._getEllipseArc=function(a,b,d,e){var f=d/2*0.5522848,h=e/2*0.5522848,j=a+d,k=b+e,d=a+d/2,e=b+e/2;this._activeInstructions.push(new c(this._ctx.moveTo,[a,e]),new c(this._ctx.bezierCurveTo,[a,e-h,d-f,b,d,b]),new c(this._ctx.bezierCurveTo,[d+f,b,j,e-h,j,e]),new c(this._ctx.bezierCurveTo,[j,e+h,d+f,k,d,k]),
+new c(this._ctx.bezierCurveTo,[d-f,k,a,e+h,a,e]));return this};a._newPath=function(){this._dirty&&this._updateInstructions();this._oldInstructions=this._instructions;this._activeInstructions=[];this._active=this._dirty=false};a._setProp=function(a,b){this[a]=b};g.Graphics=b})(createjs||(createjs={}));(function(g){var c=function(){this.initialize()},b=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;b.alpha=1;b.cacheCanvas=null;b.id=-1;b.mouseEnabled=true;b.name=null;b.parent=null;b.regX=0;b.regY=0;b.rotation=0;b.scaleX=1;b.scaleY=1;b.skewX=0;b.skewY=0;b.shadow=null;b.visible=true;b.x=0;b.y=0;b.compositeOperation=null;b.snapToPixel=
+false;b.onPress=null;b.onClick=null;b.onDoubleClick=null;b.onMouseOver=null;b.onMouseOut=null;b.onTick=null;b.filters=null;b.cacheID=0;b.mask=null;b.hitArea=null;b._cacheOffsetX=0;b._cacheOffsetY=0;b._cacheDataURLID=0;b._cacheDataURL=null;b._matrix=null;b.initialize=function(){this.id=g.UID.get();this._matrix=new g.Matrix2D};b.isVisible=function(){return this.visible&&this.alpha>0&&this.scaleX!=0&&this.scaleY!=0};b.draw=function(a,b){if(b||!this.cacheCanvas)return false;a.drawImage(this.cacheCanvas,
+this._cacheOffsetX,this._cacheOffsetY);return true};b.updateContext=function(a){var b,c=this.mask;c&&c.graphics&&(b=c.getMatrix(c._matrix),a.transform(b.a,b.b,b.c,b.d,b.tx,b.ty),c.graphics.drawAsPath(a),a.clip(),b.invert(),a.transform(b.a,b.b,b.c,b.d,b.tx,b.ty));b=this._matrix.identity().appendTransform(this.x,this.y,this.scaleX,this.scaleY,this.rotation,this.skewX,this.skewY,this.regX,this.regY);g.Stage._snapToPixelEnabled&&this.snapToPixel?a.transform(b.a,b.b,b.c,b.d,b.tx+0.5|0,b.ty+0.5|0):a.transform(b.a,
+b.b,b.c,b.d,b.tx,b.ty);a.globalAlpha*=this.alpha;if(this.compositeOperation)a.globalCompositeOperation=this.compositeOperation;this.shadow&&this._applyShadow(a,this.shadow)};b.cache=function(a,b,n,d){var e=this.cacheCanvas;if(e==null)e=this.cacheCanvas=document.createElement("canvas");var f=e.getContext("2d");e.width=n;e.height=d;f.setTransform(1,0,0,1,-a,-b);f.clearRect(a,b,e.width,e.height);this.draw(f,true,this._matrix.reinitialize(1,0,0,1,-a,-b));this._cacheOffsetX=a;this._cacheOffsetY=b;this._applyFilters();
+this.cacheID=c._nextCacheID++};b.updateCache=function(a){var b=this.cacheCanvas,n=this._cacheOffsetX,d=this._cacheOffsetY;if(b==null)throw"cache() must be called before updateCache()";var e=b.getContext("2d");e.setTransform(1,0,0,1,-n,-d);a?e.globalCompositeOperation=a:e.clearRect(n,d,b.width,b.height);this.draw(e,true);if(a)e.globalCompositeOperation="source-over";this._applyFilters();this.cacheID=c._nextCacheID++};b.uncache=function(){this._cacheDataURL=this.cacheCanvas=null;this.cacheID=this._cacheOffsetX=
+this._cacheOffsetY=0};b.getCacheDataURL=function(){if(!this.cacheCanvas)return null;if(this.cacheID!=this._cacheDataURLID)this._cacheDataURL=this.cacheCanvas.toDataURL();return this._cacheDataURL};b.getStage=function(){for(var a=this;a.parent;)a=a.parent;return a instanceof g.Stage?a:null};b.localToGlobal=function(a,b){var c=this.getConcatenatedMatrix(this._matrix);if(c==null)return null;c.append(1,0,0,1,a,b);return new g.Point(c.tx,c.ty)};b.globalToLocal=function(a,b){var c=this.getConcatenatedMatrix(this._matrix);
+if(c==null)return null;c.invert();c.append(1,0,0,1,a,b);return new g.Point(c.tx,c.ty)};b.localToLocal=function(a,b,c){a=this.localToGlobal(a,b);return c.globalToLocal(a.x,a.y)};b.setTransform=function(a,b,c,d,e,f,h,j,k){this.x=a||0;this.y=b||0;this.scaleX=c==null?1:c;this.scaleY=d==null?1:d;this.rotation=e||0;this.skewX=f||0;this.skewY=h||0;this.regX=j||0;this.regY=k||0};b.getMatrix=function(a){return(a?a.identity():new g.Matrix2D).appendTransform(this.x,this.y,this.scaleX,this.scaleY,this.rotation,
+this.skewX,this.skewY,this.regX,this.regY).appendProperties(this.alpha,this.shadow,this.compositeOperation)};b.getConcatenatedMatrix=function(a){a?a.identity():a=new g.Matrix2D;for(var b=this;b!=null;)a.prependTransform(b.x,b.y,b.scaleX,b.scaleY,b.rotation,b.skewX,b.skewY,b.regX,b.regY).prependProperties(b.alpha,b.shadow,b.compositeOperation),b=b.parent;return a};b.hitTest=function(a,b){var n=c._hitTestContext,d=c._hitTestCanvas;n.setTransform(1,0,0,1,-a,-b);this.draw(n);n=this._testHit(n);d.width=
+0;d.width=1;return n};b.clone=function(){var a=new c;this.cloneProps(a);return a};b.toString=function(){return"[DisplayObject (name="+this.name+")]"};b.cloneProps=function(a){a.alpha=this.alpha;a.name=this.name;a.regX=this.regX;a.regY=this.regY;a.rotation=this.rotation;a.scaleX=this.scaleX;a.scaleY=this.scaleY;a.shadow=this.shadow;a.skewX=this.skewX;a.skewY=this.skewY;a.visible=this.visible;a.x=this.x;a.y=this.y;a.mouseEnabled=this.mouseEnabled;a.compositeOperation=this.compositeOperation;if(this.cacheCanvas)a.cacheCanvas=
+this.cacheCanvas.cloneNode(true),a.cacheCanvas.getContext("2d").putImageData(this.cacheCanvas.getContext("2d").getImageData(0,0,this.cacheCanvas.width,this.cacheCanvas.height),0,0)};b._applyShadow=function(a,b){b=b||Shadow.identity;a.shadowColor=b.color;a.shadowOffsetX=b.offsetX;a.shadowOffsetY=b.offsetY;a.shadowBlur=b.blur};b._tick=function(a){if(this.onTick)this.onTick(a)};b._testHit=function(a){try{var b=a.getImageData(0,0,1,1).data[3]>1}catch(n){if(!c.suppressCrossDomainErrors)throw"An error has occurred. This is most likely due to security restrictions on reading canvas pixel data with local or cross-domain images.";
+}return b};b._applyFilters=function(){if(this.filters&&this.filters.length!=0&&this.cacheCanvas)for(var a=this.filters.length,b=this.cacheCanvas.getContext("2d"),c=this.cacheCanvas.width,d=this.cacheCanvas.height,e=0;e<a;e++)this.filters[e].applyFilter(b,0,0,c,d)};g.DisplayObject=c})(createjs||(createjs={}));(function(g){var c=function(){this.initialize()},b=c.prototype=new g.DisplayObject;b.children=null;b.DisplayObject_initialize=b.initialize;b.initialize=function(){this.DisplayObject_initialize();this.children=[]};b.isVisible=function(){return this.visible&&this.alpha>0&&this.children.length&&this.scaleX!=0&&this.scaleY!=0};b.DisplayObject_draw=b.draw;b.draw=function(a,b){if(this.DisplayObject_draw(a,b))return true;for(var c=this.children.slice(0),d=0,e=c.length;d<e;d++){var f=c[d];f.isVisible()&&
+(a.save(),f.updateContext(a),f.draw(a),a.restore())}return true};b.addChild=function(a){if(a==null)return a;var b=arguments.length;if(b>1){for(var c=0;c<b;c++)this.addChild(arguments[c]);return arguments[b-1]}a.parent&&a.parent.removeChild(a);a.parent=this;this.children.push(a);return a};b.addChildAt=function(a,b){var c=arguments.length,d=arguments[c-1];if(d<0||d>this.children.length)return arguments[c-2];if(c>2){for(var e=0;e<c-1;e++)this.addChildAt(arguments[e],d+e);return arguments[c-2]}a.parent&&
+a.parent.removeChild(a);a.parent=this;this.children.splice(b,0,a);return a};b.removeChild=function(a){var b=arguments.length;if(b>1){for(var c=true,d=0;d<b;d++)c=c&&this.removeChild(arguments[d]);return c}return this.removeChildAt(this.children.indexOf(a))};b.removeChildAt=function(a){var b=arguments.length;if(b>1){for(var c=[],d=0;d<b;d++)c[d]=arguments[d];c.sort(function(a,b){return b-a});for(var e=true,d=0;d<b;d++)e=e&&this.removeChildAt(c[d]);return e}if(a<0||a>this.children.length-1)return false;
+if(b=this.children[a])b.parent=null;this.children.splice(a,1);return true};b.removeAllChildren=function(){for(var a=this.children;a.length;)a.pop().parent=null};b.getChildAt=function(a){return this.children[a]};b.sortChildren=function(a){this.children.sort(a)};b.getChildIndex=function(a){return this.children.indexOf(a)};b.getNumChildren=function(){return this.children.length};b.swapChildrenAt=function(a,b){var c=this.children,d=c[a],e=c[b];d&&e&&(c[a]=e,c[b]=d)};b.swapChildren=function(a,b){for(var c=
+this.children,d,e,f=0,h=c.length;f<h;f++)if(c[f]==a&&(d=f),c[f]==b&&(e=f),d!=null&&e!=null)break;f!=h&&(c[d]=b,c[e]=a)};b.setChildIndex=function(a,b){var c=this.children,d=c.length;if(!(a.parent!=this||b<0||b>=d)){for(var e=0;e<d;e++)if(c[e]==a)break;e==d||e==b||(c.splice(e,1),b<e&&b--,c.splice(b,0,a))}};b.contains=function(a){for(;a;){if(a==this)return true;a=a.parent}return false};b.hitTest=function(a,b){return this.getObjectUnderPoint(a,b)!=null};b.getObjectsUnderPoint=function(a,b){var c=[],d=
+this.localToGlobal(a,b);this._getObjectsUnderPoint(d.x,d.y,c);return c};b.getObjectUnderPoint=function(a,b){var c=this.localToGlobal(a,b);return this._getObjectsUnderPoint(c.x,c.y)};b.clone=function(a){var b=new c;this.cloneProps(b);if(a)for(var n=b.children=[],d=0,e=this.children.length;d<e;d++){var f=this.children[d].clone(a);f.parent=b;n.push(f)}return b};b.toString=function(){return"[Container (name="+this.name+")]"};b._tick=function(a){for(var b=this.children.length-1;b>=0;b--){var c=this.children[b];
+c._tick&&c._tick(a)}if(this.onTick)this.onTick(a)};b._getObjectsUnderPoint=function(a,b,n,d){var e=createjs.DisplayObject._hitTestContext,f=createjs.DisplayObject._hitTestCanvas,h=this._matrix,j=d&1&&(this.onPress||this.onClick||this.onDoubleClick)||d&2&&(this.onMouseOver||this.onMouseOut);if(this.cacheCanvas&&j&&(this.getConcatenatedMatrix(h),e.setTransform(h.a,h.b,h.c,h.d,h.tx-a,h.ty-b),e.globalAlpha=h.alpha,this.draw(e),this._testHit(e)))return f.width=0,f.width=1,this;for(var k=this.children.length-
+1;k>=0;k--){var l=this.children[k];if(l.isVisible()&&l.mouseEnabled)if(l instanceof c)if(j){if(l=l._getObjectsUnderPoint(a,b))return this}else{if(l=l._getObjectsUnderPoint(a,b,n,d),!n&&l)return l}else if(!d||j||d&1&&(l.onPress||l.onClick||l.onDoubleClick)||d&2&&(l.onMouseOver||l.onMouseOut)){var g=l.hitArea;l.getConcatenatedMatrix(h);g&&(h.appendTransform(g.x+l.regX,g.y+l.regY,g.scaleX,g.scaleY,g.rotation,g.skewX,g.skewY,g.regX,g.regY),h.alpha*=g.alpha/l.alpha);e.globalAlpha=h.alpha;e.setTransform(h.a,
+h.b,h.c,h.d,h.tx-a,h.ty-b);(g||l).draw(e);if(this._testHit(e))if(f.width=0,f.width=1,j)return this;else if(n)n.push(l);else return l}}return null};g.Container=c})(createjs||(createjs={}));(function(g){var c=function(a){this.initialize(a)},b=c.prototype=new g.Container;c._snapToPixelEnabled=false;b.autoClear=true;b.canvas=null;b.mouseX=null;b.mouseY=null;b.onMouseMove=null;b.onMouseUp=null;b.onMouseDown=null;b.snapToPixelEnabled=false;b.mouseInBounds=false;b.tickOnUpdate=true;b.mouseMoveOutside=false;b._pointerData=null;b._pointerCount=0;b._primaryPointerID=null;b._mouseOverIntervalID=null;b.Container_initialize=b.initialize;b.initialize=function(a){this.Container_initialize();this.canvas=
+a instanceof HTMLCanvasElement?a:document.getElementById(a);this._pointerData={};this._enableMouseEvents(true)};b.update=function(a){if(this.canvas)this.autoClear&&this.clear(),c._snapToPixelEnabled=this.snapToPixelEnabled,this.tickOnUpdate&&this._tick(a),this.draw(this.canvas.getContext("2d"),false,this.getConcatenatedMatrix(this._matrix))};b.tick=b.update;b.clear=function(){if(this.canvas){var a=this.canvas.getContext("2d");a.setTransform(1,0,0,1,0,0);a.clearRect(0,0,this.canvas.width,this.canvas.height)}};
+b.toDataURL=function(a,b){b||(b="image/png");var c=this.canvas.getContext("2d"),d=this.canvas.width,e=this.canvas.height,f;if(a){f=c.getImageData(0,0,d,e);var h=c.globalCompositeOperation;c.globalCompositeOperation="destination-over";c.fillStyle=a;c.fillRect(0,0,d,e)}var j=this.canvas.toDataURL(b);if(a)c.clearRect(0,0,d,e),c.putImageData(f,0,0),c.globalCompositeOperation=h;return j};b.enableMouseOver=function(a){if(this._mouseOverIntervalID)clearInterval(this._mouseOverIntervalID),this._mouseOverIntervalID=
+null;if(a==null)a=20;else if(a<=0)return;var b=this;this._mouseOverIntervalID=setInterval(function(){b._testMouseOver()},1E3/Math.min(50,a))};b.clone=function(){var a=new c(null);this.cloneProps(a);return a};b.toString=function(){return"[Stage (name="+this.name+")]"};b._enableMouseEvents=function(){var a=this,b=window.addEventListener?window:document;b.addEventListener("mouseup",function(b){a._handleMouseUp(b)},false);b.addEventListener("mousemove",function(b){a._handleMouseMove(b)},false);b.addEventListener("dblclick",
+function(b){a._handleDoubleClick(b)},false);this.canvas&&this.canvas.addEventListener("mousedown",function(b){a._handleMouseDown(b)},false)};b._getPointerData=function(a){var b=this._pointerData[a];if(!b&&(b=this._pointerData[a]={},this._primaryPointerID==null))this._primaryPointerID=a;return b};b._handleMouseMove=function(a){if(!a)a=window.event;this._handlePointerMove(-1,a,a.pageX,a.pageY)};b._handlePointerMove=function(a,b,c,d){if(this.canvas){var e=this._getPointerData(a),f=e.inBounds;this._updatePointerPosition(a,
+c,d);if(f||e.inBounds||this.mouseMoveOutside){a=new g.MouseEvent("onMouseMove",e.x,e.y,this,b,a,a==this._primaryPointerID,e.rawX,e.rawY);if(this.onMouseMove)this.onMouseMove(a);if(e.event&&e.event.onMouseMove)e.event.onMouseMove(a)}}};b._updatePointerPosition=function(a,b,c){var d=this.canvas;do b-=d.offsetLeft,c-=d.offsetTop;while(d=d.offsetParent);var d=this.canvas.width,e=this.canvas.height,f=this._getPointerData(a);if(f.inBounds=b>=0&&c>=0&&b<=d-1&&c<=e-1)f.x=b,f.y=c;else if(this.mouseMoveOutside)f.x=
+b<0?0:b>d-1?d-1:b,f.y=c<0?0:c>e-1?e-1:c;f.rawX=b;f.rawY=c;if(a==this._primaryPointerID)this.mouseX=f.x,this.mouseY=f.y,this.mouseInBounds=f.inBounds};b._handleMouseUp=function(a){this._handlePointerUp(-1,a,false)};b._handlePointerUp=function(a,b,c){var d=this._getPointerData(a),e=new g.MouseEvent("onMouseUp",d.x,d.y,this,b,a,a==this._primaryPointerID,d.rawX,d.rawY);if(this.onMouseUp)this.onMouseUp(e);if(d.event&&d.event.onMouseUp)d.event.onMouseUp(e);if(d.target&&d.target.onClick&&this._getObjectsUnderPoint(d.x,
+d.y,null,true,this._mouseOverIntervalID?3:1)==d.target)d.target.onClick(new g.MouseEvent("onClick",d.x,d.y,d.target,b,a,a==this._primaryPointerID,d.rawX,d.rawY));if(c){if(a==this._primaryPointerID)this._primaryPointerID=null;delete this._pointerData[a]}else d.event=d.target=null};b._handleMouseDown=function(a){this._handlePointerDown(-1,a,false)};b._handlePointerDown=function(a,b,c,d){var e=this._getPointerData(a);d!=null&&this._updatePointerPosition(a,c,d);if(this.onMouseDown)this.onMouseDown(new g.MouseEvent("onMouseDown",
+e.x,e.y,this,b,a,a==this._primaryPointerID,e.rawX,e.rawY));if(c=this._getObjectsUnderPoint(e.x,e.y,null,this._mouseOverIntervalID?3:1)){if(c.onPress&&(a=new g.MouseEvent("onPress",e.x,e.y,c,b,a,a==this._primaryPointerID,e.rawX,e.rawY),c.onPress(a),a.onMouseMove||a.onMouseUp))e.event=a;e.target=c}};b._testMouseOver=function(){if(this._primaryPointerID==-1&&!(this.mouseX==this._mouseOverX&&this.mouseY==this._mouseOverY&&this.mouseInBounds)){var a=null;if(this.mouseInBounds)a=this._getObjectsUnderPoint(this.mouseX,
+this.mouseY,null,3),this._mouseOverX=this.mouseX,this._mouseOverY=this.mouseY;if(this._mouseOverTarget!=a){if(this._mouseOverTarget&&this._mouseOverTarget.onMouseOut)this._mouseOverTarget.onMouseOut(new g.MouseEvent("onMouseOut",this.mouseX,this.mouseY,this._mouseOverTarget));if(a&&a.onMouseOver)a.onMouseOver(new g.MouseEvent("onMouseOver",this.mouseX,this.mouseY,a));this._mouseOverTarget=a}}};b._handleDoubleClick=function(a){if(this.onDoubleClick)this.onDoubleClick(new g.MouseEvent("onDoubleClick",
+this.mouseX,this.mouseY,this,a,-1,true));var b=this._getObjectsUnderPoint(this.mouseX,this.mouseY,null,this._mouseOverIntervalID?3:1);if(b&&b.onDoubleClick)b.onDoubleClick(new g.MouseEvent("onDoubleClick",this.mouseX,this.mouseY,b,a,-1,true))};g.Stage=c})(createjs||(createjs={}));(function(g){var c=function(a){this.initialize(a)},b=c.prototype=new g.DisplayObject;b.image=null;b.snapToPixel=true;b.sourceRect=null;b.DisplayObject_initialize=b.initialize;b.initialize=function(a){this.DisplayObject_initialize();typeof a=="string"?(this.image=new Image,this.image.src=a):this.image=a};b.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)};b.DisplayObject_draw=b.draw;
+b.draw=function(a,b){if(this.DisplayObject_draw(a,b))return true;var c=this.sourceRect;c?a.drawImage(this.image,c.x,c.y,c.width,c.height,0,0,c.width,c.height):a.drawImage(this.image,0,0);return true};b.clone=function(){var a=new c(this.image);this.cloneProps(a);return a};b.toString=function(){return"[Bitmap (name="+this.name+")]"};g.Bitmap=c})(createjs||(createjs={}));(function(g){var c=function(a){this.initialize(a)},b=c.prototype=new g.DisplayObject;b.onAnimationEnd=null;b.currentFrame=-1;b.currentAnimation=null;b.paused=true;b.spriteSheet=null;b.snapToPixel=true;b.offset=0;b.currentAnimationFrame=0;b._advanceCount=0;b._animation=null;b.DisplayObject_initialize=b.initialize;b.initialize=function(a){this.DisplayObject_initialize();this.spriteSheet=a};b.isVisible=function(){return this.visible&&this.alpha>0&&this.scaleX!=0&&this.scaleY!=0&&this.spriteSheet.complete&&
+this.currentFrame>=0};b.DisplayObject_draw=b.draw;b.draw=function(a,b){if(this.DisplayObject_draw(a,b))return true;this._normalizeFrame();var c=this.spriteSheet.getFrame(this.currentFrame);if(c!=null){var d=c.rect;a.drawImage(c.image,d.x,d.y,d.width,d.height,-c.regX,-c.regY,d.width,d.height);return true}};b.play=function(){this.paused=false};b.stop=function(){this.paused=true};b.gotoAndPlay=function(a){this.paused=false;this._goto(a)};b.gotoAndStop=function(a){this.paused=true;this._goto(a)};b.advance=
+function(){this._animation?this.currentAnimationFrame++:this.currentFrame++;this._normalizeFrame()};b.clone=function(){var a=new c(this.spriteSheet);this.cloneProps(a);return a};b.toString=function(){return"[BitmapAnimation (name="+this.name+")]"};b._tick=function(a){var b=this._animation?this._animation.frequency:1;!this.paused&&(++this._advanceCount+this.offset)%b==0&&this.advance();if(this.onTick)this.onTick(a)};b._normalizeFrame=function(){var a=this._animation;if(a)if(this.currentAnimationFrame>=
+a.frames.length){if(a.next?this._goto(a.next):(this.paused=true,this.currentAnimationFrame=a.frames.length-1,this.currentFrame=a.frames[this.currentAnimationFrame]),this.onAnimationEnd)this.onAnimationEnd(this,a.name)}else this.currentFrame=a.frames[this.currentAnimationFrame];else if(this.currentFrame>=this.spriteSheet.getNumFrames()&&(this.currentFrame=0,this.onAnimationEnd))this.onAnimationEnd(this,null)};b.DisplayObject_cloneProps=b.cloneProps;b.cloneProps=function(a){this.DisplayObject_cloneProps(a);
+a.onAnimationEnd=this.onAnimationEnd;a.currentFrame=this.currentFrame;a.currentAnimation=this.currentAnimation;a.paused=this.paused;a.offset=this.offset;a._animation=this._animation;a.currentAnimationFrame=this.currentAnimationFrame};b._goto=function(a){if(isNaN(a)){var b=this.spriteSheet.getAnimation(a);if(b)this.currentAnimationFrame=0,this._animation=b,this.currentAnimation=a,this._normalizeFrame()}else this.currentAnimation=this._animation=null,this.currentFrame=a};g.BitmapAnimation=c})(createjs||
+(createjs={}));(function(g){var c=function(a){this.initialize(a)},b=c.prototype=new g.DisplayObject;b.graphics=null;b.DisplayObject_initialize=b.initialize;b.initialize=function(a){this.DisplayObject_initialize();this.graphics=a?a:new g.Graphics};b.isVisible=function(){return this.visible&&this.alpha>0&&this.scaleX!=0&&this.scaleY!=0&&this.graphics};b.DisplayObject_draw=b.draw;b.draw=function(a,b){if(this.DisplayObject_draw(a,b))return true;this.graphics.draw(a);return true};b.clone=function(a){a=new c(a&&this.graphics?
+this.graphics.clone():this.graphics);this.cloneProps(a);return a};b.toString=function(){return"[Shape (name="+this.name+")]"};g.Shape=c})(createjs||(createjs={}));(function(g){var c=function(a,b,c){this.initialize(a,b,c)},b=c.prototype=new g.DisplayObject;c._workingContext=document.createElement("canvas").getContext("2d");b.text="";b.font=null;b.color=null;b.textAlign=null;b.textBaseline=null;b.maxWidth=null;b.outline=false;b.lineHeight=0;b.lineWidth=null;b.DisplayObject_initialize=b.initialize;b.initialize=function(a,b,c){this.DisplayObject_initialize();this.text=a;this.font=b;this.color=c?c:"#000"};b.isVisible=function(){return Boolean(this.visible&&this.alpha>
+0&&this.scaleX!=0&&this.scaleY!=0&&this.text!=null&&this.text!=="")};b.DisplayObject_draw=b.draw;b.draw=function(a,b){if(this.DisplayObject_draw(a,b))return true;this.outline?a.strokeStyle=this.color:a.fillStyle=this.color;a.font=this.font;a.textAlign=this.textAlign||"start";a.textBaseline=this.textBaseline||"alphabetic";this._drawText(a);return true};b.getMeasuredWidth=function(){return this._getWorkingContext().measureText(this.text).width};b.getMeasuredLineHeight=function(){return this._getWorkingContext().measureText("M").width*
+1.2};b.getMeasuredHeight=function(){return this._drawText()*(this.lineHeight||this.getMeasuredLineHeight())};b.clone=function(){var a=new c(this.text,this.font,this.color);this.cloneProps(a);return a};b.toString=function(){return"[Text (text="+(this.text.length>20?this.text.substr(0,17)+"...":this.text)+")]"};b.DisplayObject_cloneProps=b.cloneProps;b.cloneProps=function(a){this.DisplayObject_cloneProps(a);a.textAlign=this.textAlign;a.textBaseline=this.textBaseline;a.maxWidth=this.maxWidth;a.outline=
+this.outline;a.lineHeight=this.lineHeight;a.lineWidth=this.lineWidth};b._getWorkingContext=function(){var a=c._workingContext;a.font=this.font;a.textAlign=this.textAlign||"start";a.textBaseline=this.textBaseline||"alphabetic";return a};b._drawText=function(a){var b=!!a;b||(a=this._getWorkingContext());for(var c=String(this.text).split(/(?:\r\n|\r|\n)/),d=this.lineHeight||this.getMeasuredLineHeight(),e=0,f=0,h=c.length;f<h;f++){var j=a.measureText(c[f]).width;if(this.lineWidth==null||j<this.lineWidth)b&&
+this._drawTextLine(a,c[f],e*d);else{for(var j=c[f].split(/(\s)/),k=j[0],g=1,o=j.length;g<o;g+=2)a.measureText(k+j[g]+j[g+1]).width>this.lineWidth?(b&&this._drawTextLine(a,k,e*d),e++,k=j[g+1]):k+=j[g]+j[g+1];b&&this._drawTextLine(a,k,e*d)}e++}return e};b._drawTextLine=function(a,b,c){this.outline?a.strokeText(b,0,c,this.maxWidth||65535):a.fillText(b,0,c,this.maxWidth||65535)};g.Text=c})(createjs||(createjs={}));(function(g){var c=function(){throw"SpriteSheetUtils cannot be instantiated";};c._workingCanvas=document.createElement("canvas");c._workingContext=c._workingCanvas.getContext("2d");c.addFlippedFrames=function(b,a,i,g){if(a||i||g){var d=0;a&&c._flip(b,++d,true,false);i&&c._flip(b,++d,false,true);g&&c._flip(b,++d,true,true)}};c.extractFrame=function(b,a){isNaN(a)&&(a=b.getAnimation(a).frames[0]);var i=b.getFrame(a);if(!i)return null;var g=i.rect,d=c._workingCanvas;d.width=g.width;d.height=g.height;
+c._workingContext.drawImage(i.image,g.x,g.y,g.width,g.height,0,0,g.width,g.height);i=new Image;i.src=d.toDataURL("image/png");return i};c._flip=function(b,a,i,g){for(var d=b._images,e=c._workingCanvas,f=c._workingContext,h=d.length/a,j=0;j<h;j++){var k=d[j];k.__tmp=j;e.width=k.width;e.height=k.height;f.setTransform(i?-1:1,0,0,g?-1:1,i?k.width:0,g?k.height:0);f.drawImage(k,0,0);var l=new Image;l.src=e.toDataURL("image/png");l.width=k.width;l.height=k.height;d.push(l)}f=b._frames;e=f.length/a;for(j=
+0;j<e;j++){var k=f[j],o=k.rect.clone(),l=d[k.image.__tmp+h*a],m={image:l,rect:o,regX:k.regX,regY:k.regY};if(i)o.x=l.width-o.x-o.width,m.regX=o.width-k.regX;if(g)o.y=l.height-o.y-o.height,m.regY=o.height-k.regY;f.push(m)}i="_"+(i?"h":"")+(g?"v":"");g=b._animations;b=b._data;d=g.length/a;for(j=0;j<d;j++){f=g[j];k=b[f];h={name:f+i,frequency:k.frequency,next:k.next,frames:[]};k.next&&(h.next+=i);f=k.frames;k=0;for(l=f.length;k<l;k++)h.frames.push(f[k]+e*a);b[h.name]=h;g.push(h.name)}};g.SpriteSheetUtils=
+c})(createjs||(createjs={}));(function(g){var c=function(){this.initialize()},b=c.prototype;c.ERR_DIMENSIONS="frame dimensions exceed max spritesheet dimensions";c.ERR_RUNNING="a build is already running";b.maxWidth=2048;b.maxHeight=2048;b.spriteSheet=null;b.scale=1;b._frames=null;b._animations=null;b._data=null;b._nextFrameIndex=0;b._index=0;b._callback=null;b._timeSlice=null;b._timerID=null;b._scale=1;b.initialize=function(){this._frames=[];this._animations={}};b.addFrame=function(a,b,g,d,e,f){if(this._data)throw c.ERR_RUNNING;
+b=b||a.bounds||a.nominalBounds;!b&&a.getBounds&&(b=a.getBounds());if(!b)return null;g=g||1;return this._frames.push({source:a,sourceRect:b,scale:g,funct:d,params:e,scope:f,index:this._frames.length,height:b.height*g})-1};b.addAnimation=function(a,b,g,d){if(this._data)throw c.ERR_RUNNING;this._animations[a]={frames:b,next:g,frequency:d}};b.addMovieClip=function(a,b,g){if(this._data)throw c.ERR_RUNNING;var d=a.frameBounds,b=b||a.bounds||a.nominalBounds;!b&&a.getBounds&&(b=a.getBounds());if(!b&&!d)return null;
+for(var e=a.timeline.duration,f=0;f<e;f++)this.addFrame(a,d&&d[f]?d[f]:b,g,function(a){var b=this.actionsEnabled;this.actionsEnabled=false;this.gotoAndStop(a);this.actionsEnabled=b},[f],a);var a=a.timeline._labels,h;for(h in a)this.addAnimation(h,a[h],true)};b.build=function(){if(this._data)throw c.ERR_RUNNING;this._callback=null;for(this._startBuild();this._drawNext(););this._endBuild();return this.spriteSheet};b.buildAsync=function(a,b){if(this._data)throw c.ERR_RUNNING;this._callback=a;this._startBuild();
+this._timeSlice=Math.max(0.01,Math.min(0.99,b||0.3))*50;var g=this;this._timerID=setTimeout(function(){g._run()},50-this._timeSlice)};b.stopAsync=function(){clearTimeout(this._timerID);this._data=null};b.clone=function(){throw"SpriteSheetBuilder cannot be cloned.";};b.toString=function(){return"[SpriteSheetBuilder]"};b._startBuild=function(){this.spriteSheet=null;this._index=0;this._scale=this.scale;var a=[];this._data={images:[],frames:a,animations:this._animations};var b=this._frames.slice();b.sort(function(a,
+b){return a.height<=b.height?-1:1});if(b[b.length-1].height>this.maxHeight)throw c.ERR_DIMENSIONS;for(var g=1,d=1,e=0;b.length;){var f=this._fillRow(b,g,e,a);if(f.w>d)d=f.w;g+=f.h+2;if(!f.h||!b.length){var h=document.createElement("canvas");h.width=this._getSize(d,this.maxWidth);h.height=this._getSize(g,this.maxHeight);this._data.images[e]=h;f.h||(d=g=1,e++)}}};b._getSize=function(a,b){for(var c=4;Math.pow(2,++c)<a;);return Math.min(b,Math.pow(2,c))};b._fillRow=function(a,b,n,d){for(var e=this.maxWidth,
+f=this.maxHeight-b,h=1,j=0,k=a.length-1;k>=0;k--){var l=a[k],o=this._scale*l.scale,m=l.sourceRect,q=l.source,r=Math.floor(o*m.x-1),p=Math.floor(o*m.y-1),s=Math.ceil(o*m.height),m=Math.ceil(o*m.width);if(m>e)throw c.ERR_DIMENSIONS;if(!(s>f||h+m>e))l.img=n,l.rect=new g.Rectangle(h,b,m,s),j=j||s,a.splice(k,1),d[l.index]=[h-1,b-1,m+2,s+2,n,Math.round(-r+o*q.regX),Math.round(-p+o*q.regY)],h+=m+2}return{w:h,h:j}};b._endBuild=function(){this.spriteSheet=new g.SpriteSheet(this._data);this._data=null;this._callback&&
+this._callback(this)};b._run=function(){for(var a=(new Date).getTime()+this._timeSlice,b=false;a>(new Date).getTime();)if(!this._drawNext()){b=true;break}if(b)this._endBuild();else{var c=this;this._timerID=setTimeout(function(){c._run()},50-this._timeSlice)}};b._drawNext=function(){var a=this._frames[this._index],b=a.scale*this._scale,c=a.rect,d=a.sourceRect,e=this._data.images[a.img].getContext("2d");a.funct&&a.funct.apply(a.scope,a.params);e.save();e.beginPath();e.rect(c.x-1,c.y-1,c.width+2,c.height+
+2);e.clip();e.translate(c.x-d.x*b+0.5|0,c.y-d.y*b+0.5|0);e.scale(b,b);a.source.draw(e);e.restore();return++this._index<this._frames.length};g.SpriteSheetBuilder=c})(createjs||(createjs={}));(function(g){var c=function(a){this.initialize(a)},b=c.prototype=new g.DisplayObject;b.htmlElement=null;b._style=null;b.DisplayObject_initialize=b.initialize;b.initialize=function(a){typeof a=="string"&&(a=document.getElementById(a));this.DisplayObject_initialize();this.mouseEnabled=false;if(this.htmlElement=a)this._style=a.style,this._style.position="absolute",this._style.transformOrigin=this._style.webkitTransformOrigin=this._style.msTransformOrigin=this._style.MozTransformOrigin="0% 0%"};b.isVisible=
+function(){return this.htmlElement!=null};b.draw=function(){if(this.htmlElement!=null){var a=this.getConcatenatedMatrix(this._matrix),b=this.htmlElement;b.style.opacity=""+a.alpha;b.style.visibility=this.visible?"visible":"hidden";b.style.transform=b.style.webkitTransform=b.style.oTransform=b.style.msTransform=["matrix("+a.a,a.b,a.c,a.d,a.tx+0.5|0,(a.ty+0.5|0)+")"].join(",");b.style.MozTransform=["matrix("+a.a,a.b,a.c,a.d,(a.tx+0.5|0)+"px",(a.ty+0.5|0)+"px)"].join(",");return true}};b.cache=function(){};
+b.uncache=function(){};b.updateCache=function(){};b.hitTest=function(){};b.localToGlobal=function(){};b.globalToLocal=function(){};b.localToLocal=function(){};b.clone=function(){var a=new c;this.cloneProps(a);return a};b.toString=function(){return"[DOMElement (name="+this.name+")]"};b._tick=function(a){if(this.htmlElement!=null&&(this.htmlElement.style.visibility="hidden",this.onTick))this.onTick(a)};g.DOMElement=c})(createjs||(createjs={}));(function(g){var c=function(){this.initialize()},b=c.prototype;b.initialize=function(){};b.getBounds=function(){return new g.Rectangle(0,0,0,0)};b.applyFilter=function(){};b.toString=function(){return"[Filter]"};b.clone=function(){return new c};g.Filter=c})(createjs||(createjs={}));(function(g){var c=function(){throw"Touch cannot be instantiated";};c.isSupported=function(){return"ontouchstart"in window||window.navigator.msPointerEnabled};c.enable=function(b,a,g){if(!b||!b.canvas||!c.isSupported())return false;b.__touch={pointers:{},multitouch:!a,preventDefault:!g,count:0};"ontouchstart"in window?c._IOS_enable(b):window.navigator.msPointerEnabled&&c._IE_enable(b);return true};c._IOS_enable=function(b){var a=b.canvas;a.addEventListener("touchstart",function(a){c._IOS_handleEvent(b,
+a)},false);a.addEventListener("touchmove",function(a){c._IOS_handleEvent(b,a)},false);a.addEventListener("touchend",function(a){c._IOS_handleEvent(b,a)},false);a.addEventListener("touchcancel",function(a){c._IOS_handleEvent(b,a)},false)};c._IOS_handleEvent=function(b,a){b.__touch.preventDefault&&a.preventDefault&&a.preventDefault();for(var c=a.changedTouches,g=a.type,d=0,e=c.length;d<e;d++){var f=c[d],h=f.identifier;f.target==b.canvas&&(g=="touchstart"?this._handleStart(b,h,a,f.pageX,f.pageY):g==
+"touchmove"?this._handleMove(b,h,a,f.pageX,f.pageY):(g=="touchend"||g=="touchcancel")&&this._handleEnd(b,h,a))}};c._IE_enable=function(b){var a=b.canvas;a.addEventListener("MSPointerDown",function(a){c._IE_handleEvent(b,a)},false);window.addEventListener("MSPointerMove",function(a){c._IE_handleEvent(b,a)},false);window.addEventListener("MSPointerUp",function(a){c._IE_handleEvent(b,a)},false);window.addEventListener("MSPointerCancel",function(a){c._IE_handleEvent(b,a)},false);if(b.__touch.preventDefault)a.style.msTouchAction=
+"none";b.__touch.activeIDs={}};c._IE_handleEvent=function(b,a){b.__touch.preventDefault&&a.preventDefault&&a.preventDefault();var c=a.type,g=a.pointerId,d=b.__touch.activeIDs;if(c=="MSPointerDown")a.srcElement==b.canvas&&(d[g]=true,this._handleStart(b,g,a,a.pageX,a.pageY));else if(d[g])if(c=="MSPointerMove")this._handleMove(b,g,a,a.pageX,a.pageY);else if(c=="MSPointerUp"||c=="MSPointerCancel")delete d[g],this._handleEnd(b,g,a)};c._handleStart=function(b,a,c,g,d){var e=b.__touch;if(e.multitouch||!e.count){var f=
+e.pointers;f[a]||(f[a]=true,e.count++,b._handlePointerDown(a,c,g,d))}};c._handleMove=function(b,a,c,g,d){b.__touch.pointers[a]&&b._handlePointerMove(a,c,g,d)};c._handleEnd=function(b,a,c){var g=b.__touch,d=g.pointers;d[a]&&(g.count--,b._handlePointerUp(a,c,true),delete d[a])};g.Touch=c})(createjs||(createjs={}));
View
39 examples/assets/preloadjs-NEXT.min.js
@@ -0,0 +1,39 @@
+/**
+* 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.
+**/(function(b){var e=function(){this.init()};e.prototype={};var a=e.prototype;a.loaded=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.onLoadStart)this.onLoadStart({target:this})};a._sendProgress=function(a){var c;if(a instanceof Number)this.progress=a,c={loaded:this.progress,
+total:1};else if(c=a,this.progress=a.loaded/a.total,isNaN(this.progress)||this.progress==Infinity)this.progress=0;c.target=this;if(this.onProgress)this.onProgress(c)};a._sendFileProgress=function(a){if(this.onFileProgress)a.target=this,this.onFileProgress(a)};a._sendComplete=function(){if(this.onComplete)this.onComplete({target:this})};a._sendFileComplete=function(a){if(this.onFileLoad)a.target=this,this.onFileLoad(a)};a._sendError=function(a){if(this.onError)a==null&&(a={}),a.target=this,this.onError(a)};
+a.toString=function(){return"[PreloadJS AbstractLoader]"};b.AbstractLoader=e})(createjs||(createjs={}));var createjs;(function(b){var e=function(c){this.initialize(c)},a=e.prototype=new b.AbstractLoader;e.IMAGE="image";e.SVG="svg";e.SOUND="sound";e.JSON="json";e.JAVASCRIPT="javascript";e.CSS="css";e.XML="xml";e.TEXT="text";e.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(c){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=c!=false&&window.XMLHttpRequest!=null;this.determineCapabilities()};
+a.determineCapabilities=function(){var c=b.BrowserDetect;if(c!=null)b.PreloadJS.TAG_LOAD_OGGS=c.isFirefox||c.isOpera};e.isBinary=function(c){switch(c){case b.PreloadJS.IMAGE:case b.PreloadJS.SOUND:return true;default:return false}};a.installPlugin=function(c){if(!(c==null||c.getPreloadHandlers==null)){c=c.getPreloadHandlers();if(c.types!=null)for(var a=0,b=c.types.length;a<b;a++)this.typeHandlers[c.types[a]]=c.callback;if(c.extensions!=null)for(a=0,b=c.extensions.length;a<b;a++)this.extensionHandlers[c.extensions[a]]=
+c.callback}};a.setMaxConnections=function(c){this._maxConnections=c;this._paused||this._loadNext()};a.loadFile=function(c,a){c==null?this._sendError({text:"File is null."}):(this._addItem(c),a!==false&&this.setPaused(false))};a.loadManifest=function(c,a){var b;if(c instanceof Array){if(c.length==0){this._sendError({text:"Manifest is empty."});return}b=c}else{if(c==null){this._sendError({text:"Manifest is null."});return}b=[c]}for(var d=0,e=b.length;d<e;d++)this._addItem(b[d],false);a!==false&&this._loadNext()};
+a.load=function(){this.setPaused(false)};a.getResult=function(c){return this._loadedItemsById[c]||this._loadedItemsBySrc[c]};a.setPaused=function(c){(this._paused=c)||this._loadNext()};a.close=function(){for(;this._currentLoads.length;)this._currentLoads.pop().cancel();this._currentLoads=[];this._scriptOrder=[];this._loadedScripts=[]};a._addItem=function(c){c=this._createLoadItem(c);c!=null&&(this._loadQueue.push(c),this._numItems++,this._updateProgress(),c.getItem().type==b.PreloadJS.JAVASCRIPT&&
+(this._scriptOrder.push(c.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(c){c.onProgress=b.PreloadJS.proxy(this._handleProgress,
+this);c.onComplete=b.PreloadJS.proxy(this._handleFileComplete,this);c.onError=b.PreloadJS.proxy(this._handleFileError,this);this._currentLoads.push(c);c.load()};a._handleFileError=function(c){var c=c.target,a=this._createResultData(c.getItem());this._numItemsLoaded++;this._updateProgress();this._sendError(a);this.stopOnError||(this._removeLoadItem(c),this._loadNext())};a._createResultData=function(c){var a={id:c.id,result:null,data:c.data,type:c.type,src:c.src};this._loadedItemsById[c.id]=a;return this._loadedItemsBySrc[c.src]=
+a};a._handleFileComplete=function(c){var c=c.target,a=c.getItem(),d=this._createResultData(a);this._removeLoadItem(c);d.result=c instanceof b.XHRLoader?this._createResult(a,c.getResult()):a.tag;switch(a.type){case b.PreloadJS.IMAGE:if(c instanceof b.XHRLoader){var e=this;d.result.onload=function(){e._handleFileTagComplete(a,d)};return}break;case b.PreloadJS.JAVASCRIPT:if(this.maintainScriptOrder){this._loadedScripts[this._scriptOrder.indexOf(a)]=a;this._checkScriptLoadOrder(c);return}}this._handleFileTagComplete(a,
+d)};a._checkScriptLoadOrder=function(){for(var c=this._loadedScripts.length,a=0;a<c;a++){var b=this._loadedScripts[a];if(b===null)break;if(b!==true){var d=this.getResult(b.src),b=this.getResult(b.id);b.result=d.result;this._handleFileTagComplete(d,b);this._loadedScripts[a]=true;a--;c--}}};a._handleFileTagComplete=function(c,a){this._numItemsLoaded++;c.completeHandler&&c.completeHandler(a);this._updateProgress();this._sendFileComplete(a);this._loadNext()};a._removeLoadItem=function(c){for(var a=this._currentLoads.length,
+b=0;b<a;b++)if(this._currentLoads[b]==c){this._currentLoads.splice(b,1);break}};a._createResult=function(c,a){var d=null,e;switch(c.type){case b.PreloadJS.IMAGE:d=this._createImage();break;case b.PreloadJS.SOUND:d=c.tag||this._createAudio();break;case b.PreloadJS.CSS:d=this._createLink();break;case b.PreloadJS.JAVASCRIPT:d=this._createScript();break;case b.PreloadJS.SVG:var d=this._createSVG(),g=this._createXML(a,"image/svg+xml");d.appendChild(g);break;case b.PreloadJS.XML:e=this._createXML(a,"text/xml");
+break;case b.PreloadJS.JSON:case b.PreloadJS.TEXT:e=a}if(d){if(c.type==b.PreloadJS.CSS)d.href=c.src;else if(c.type!=b.PreloadJS.SVG)d.src=c.src;return d}else return e};a._createXML=function(c,a){var b;window.DOMParser?(b=new DOMParser,b=b.parseFromString(c,a)):(b=new ActiveXObject("Microsoft.XMLDOM"),b.async=false,b.loadXML(c));return b};a._handleProgress=function(c){var c=c.target,a=this._createResultData(c.getItem());a.progress=c.progress;this._sendFileProgress(a);this._updateProgress()};a._updateProgress=
+function(){var c=this._numItemsLoaded/this._numItems,a=this._numItems-this._numItemsLoaded;if(a>0){for(var b=0,d=0,e=this._currentLoads.length;d<e;d++)b+=this._currentLoads[d].progress;c+=b/a*(a/this._numItems)}this._sendProgress({loaded:c,total:1})};a._createLoadItem=function(a){var d={};switch(typeof a){case "string":d.src=a;break;case "object":a instanceof HTMLAudioElement?(d.tag=a,d.src=d.tag.src,d.type=b.PreloadJS.SOUND):d=a}d.ext=this._getNameAfter(d.src,".");if(!d.type)d.type=this.getType(d.ext);
+if(d.id==null||d.id=="")d.id=d.src;if(a=this.typeHandlers[d.type]||this.extensionHandlers[d.ext]){a=a(d.src,d.type,d.id,d.data);if(a===false)return null;else if(a!==true){if(a.src!=null)d.src=a.src;if(a.id!=null)d.id=a.id;if(a.tag!=null&&a.tag.load instanceof Function)d.tag=a.tag}d.ext=this._getNameAfter(d.src,".")}a=this.useXHR;switch(d.type){case b.PreloadJS.JSON:case b.PreloadJS.XML:case b.PreloadJS.TEXT:a=true;break;case b.PreloadJS.SOUND:d.ext=="ogg"&&b.PreloadJS.TAG_LOAD_OGGS&&(a=false)}return this.useXHR==
+true&&(d.type==b.PreloadJS.IMAGE||d.type==b.PreloadJS.SVG)?(d=this._createTagItem(d),d.useXHR=true,d):a?new b.XHRLoader(d):d.tag?new b.TagLoader(d):this._createTagItem(d)};a._createTagItem=function(a){var d,e="src",f=false;switch(a.type){case b.PreloadJS.IMAGE:d=this._createImage();break;case b.PreloadJS.SOUND:d=this._createAudio();break;case b.PreloadJS.CSS:e="href";f=true;d=this._createLink();break;case b.PreloadJS.JAVASCRIPT:f=true;d=this._createScript();break;case b.PreloadJS.SVG:e="data",d=this._createSVG()}a.tag=
+d;return new b.TagLoader(a,e,f)};a.getType=function(a){switch(a){case "jpeg":case "jpg":case "gif":case "png":return b.PreloadJS.IMAGE;case "ogg":case "mp3":case "wav":return b.PreloadJS.SOUND;case "json":return b.PreloadJS.JSON;case "xml":return b.PreloadJS.XML;case "css":return b.PreloadJS.CSS;case "js":return b.PreloadJS.JAVASCRIPT;case "svg":return b.PreloadJS.SVG;default:return b.PreloadJS.TEXT}};a._getNameAfter=function(a,d){var b=a.lastIndexOf(d),b=a.substr(b+1),e=b.lastIndexOf(/[\b|\?|\#|\s]/);
+return e==-1?b:b.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]"};e.proxy=function(a,d){return function(b){return a.apply(d,arguments)}};b.PreloadJS=e;var d=function(){};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();b.BrowserDetect=d})(createjs||(createjs={}));(function(b){var e=function(a,c,b){this.init(a,c,b)},a=e.prototype=new b.AbstractLoader;a._srcAttr=null;a._loadTimeOutTimeout=null;a.tagCompleteProxy=null;a.init=function(a,c,e){this._item=a;this._srcAttr=c||"src";this.useXHR=e==true;this.isAudio=a.tag instanceof HTMLAudioElement;this.tagCompleteProxy=b.PreloadJS.proxy(this._handleTagLoad,this)};a.cancel=function(){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 b.XHRLoader(a);a.onProgress=b.PreloadJS.proxy(this._handleProgress,this);a.onFileLoad=b.PreloadJS.proxy(this._handleXHRComplete,this);a.onComplete=b.PreloadJS.proxy(this._handleXHRComplete,this);a.onError=b.PreloadJS.proxy(this._handleLoadError,this);a.load()};a._handleXHRComplete=function(a){this._clean();a.target.onFileLoad=null;a.target.onComplete=null;var c=a.target.getItem();a.target.getResult();c.type==b.PreloadJS.IMAGE?(c.tag.onload=b.PreloadJS.proxy(this._sendComplete,
+this),c.tag.src=c.src):(c.tag[this._srcAttr]=c.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(),c=a.tag;clearTimeout(this._loadTimeOutTimeout);this._loadTimeOutTimeout=setTimeout(b.PreloadJS.proxy(this._handleLoadTimeOut,this),b.PreloadJS.TIMEOUT_TIME);if(this.isAudio)c.src=null,c.preload="auto",c.setAttribute("data-temp","true");c.onerror=b.PreloadJS.proxy(this._handleLoadError,
+this);c.onprogress=b.PreloadJS.proxy(this._handleProgress,this);this.isAudio?(c.onstalled=b.PreloadJS.proxy(this._handleStalled,this),c.addEventListener("canplaythrough",this.tagCompleteProxy,false)):c.onload=b.PreloadJS.proxy(this._handleTagLoad,this);c[this._srcAttr]=a.src;a.type==b.PreloadJS.SVG&&document.getElementsByTagName("body")[0].appendChild(c);a=a.type==b.PreloadJS.SOUND&&a.ext=="ogg"&&b.BrowserDetect.isFirefox;c.load!=null&&!a&&c.load()};a._handleLoadTimeOut=function(){this._clean();this._sendError()};
+a._handleStalled=function(){};a._handleLoadError=function(){this._clean();this._sendError()};a._handleTagLoad=function(){var a=this.getItem().tag;clearTimeout(this._loadTimeOutTimeout);if(!(this.loaded||this.isAudio&&a.readyState!==4))this.getItem().type==b.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("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]"};b.TagLoader=e})(createjs||(createjs={}));(function(b){var e=function(a){this.init(a)},a=e.prototype=new b.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._clean();this._request.abort()};a.load=function(){if(this._request==null)this.handleError();else{if(this._xhrLevel==1)this._loadTimeOutTimeout=setTimeout(b.PreloadJS.proxy(this.handleTimeout,
+this),b.PreloadJS.TIMEOUT_TIME);this._request.onloadstart=b.PreloadJS.proxy(this.handleLoadStart,this);this._request.onprogress=b.PreloadJS.proxy(this.handleProgress,this);this._request.onabort=b.PreloadJS.proxy(this.handleAbort,this);this._request.onerror=b.PreloadJS.proxy(this.handleError,this);this._request.ontimeout=b.PreloadJS.proxy(this.handleTimeout,this);this._request.onload=b.PreloadJS.proxy(this.handleLoad,this);this._request.onreadystatechange=b.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(c){return null}a.type==b.PreloadJS.TEXT&&this._request.overrideMimeType&&this._request.overrideMimeType("text/plain; charset=x-user-defined");this._request.open("GET",a.src,true);if(b.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]"};b.XHRLoader=e})(createjs||(createjs={}));
View
40 examples/assets/soundjs.flashplugin-0.2.0.min.js
@@ -1,40 +0,0 @@
-/**
-* SoundJS Flash Plugin.
-* Visit http://createjs.com/ for documentation, updates and examples.
-* Contains SWFObject (http://code.google.com/p/swfobject/)
-*
-* 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.
-**/
-var swfobject=function(){function n(){if(!x){try{var b=e.getElementsByTagName("body")[0].appendChild(e.createElement("span"));b.parentNode.removeChild(b)}catch(c){return}x=!0;for(var b=C.length,k=0;k<b;k++)C[k]()}}function h(b){x?b():C[C.length]=b}function z(b){if(typeof p.addEventListener!=l)p.addEventListener("load",b,!1);else if(typeof e.addEventListener!=l)e.addEventListener("load",b,!1);else if(typeof p.attachEvent!=l)U(p,"onload",b);else if(typeof p.onload=="function"){var c=p.onload;p.onload=
-function(){c();b()}}else p.onload=b}function D(){var b=e.getElementsByTagName("body")[0],c=e.createElement(t);c.setAttribute("type",E);var k=b.appendChild(c);if(k){var q=0;(function(){if(typeof k.GetVariable!=l){var g=k.GetVariable("$version");if(g)g=g.split(" ")[1].split(","),f.pv=[parseInt(g[0],10),parseInt(g[1],10),parseInt(g[2],10)]}else if(q<10){q++;setTimeout(arguments.callee,10);return}b.removeChild(c);k=null;a()})()}else a()}function a(){var b=u.length;if(b>0)for(var c=0;c<b;c++){var k=u[c].id,
-a=u[c].callbackFn,g={success:!1,id:k};if(f.pv[0]>0){var e=o(k);if(e)if(F(u[c].swfVersion)&&!(f.wk&&f.wk<312)){if(y(k,!0),a)g.success=!0,g.ref=d(k),a(g)}else if(u[c].expressInstall&&j()){g={};g.data=u[c].expressInstall;g.width=e.getAttribute("width")||"0";g.height=e.getAttribute("height")||"0";if(e.getAttribute("class"))g.styleclass=e.getAttribute("class");if(e.getAttribute("align"))g.align=e.getAttribute("align");for(var i={},e=e.getElementsByTagName("param"),V=e.length,m=0;m<V;m++)e[m].getAttribute("name").toLowerCase()!=
-"movie"&&(i[e[m].getAttribute("name")]=e[m].getAttribute("value"));J(g,i,k,a)}else v(e),a&&a(g)}else if(y(k,!0),a){if((k=d(k))&&typeof k.SetVariable!=l)g.success=!0,g.ref=k;a(g)}}}function d(b){var c=null;if((b=o(b))&&b.nodeName=="OBJECT")typeof b.SetVariable!=l?c=b:(b=b.getElementsByTagName(t)[0])&&(c=b);return c}function j(){return!G&&F("6.0.65")&&(f.win||f.mac)&&!(f.wk&&f.wk<312)}function J(b,c,k,a){G=!0;K=a||null;N={success:!1,id:k};var g=o(k);if(g){g.nodeName=="OBJECT"?(B=r(g),H=null):(B=g,H=
-k);b.id=O;if(typeof b.width==l||!/%$/.test(b.width)&&parseInt(b.width,10)<310)b.width="310";if(typeof b.height==l||!/%$/.test(b.height)&&parseInt(b.height,10)<137)b.height="137";e.title=e.title.slice(0,47)+" - Flash Player Installation";a=f.ie&&f.win?"ActiveX":"PlugIn";a="MMredirectURL="+encodeURI(window.location).toString().replace(/&/g,"%26")+"&MMplayerType="+a+"&MMdoctitle="+e.title;typeof c.flashvars!=l?c.flashvars+="&"+a:c.flashvars=a;if(f.ie&&f.win&&g.readyState!=4)a=e.createElement("div"),
-k+="SWFObjectNew",a.setAttribute("id",k),g.parentNode.insertBefore(a,g),g.style.display="none",function(){g.readyState==4?g.parentNode.removeChild(g):setTimeout(arguments.callee,10)}();L(b,c,k)}}function v(b){if(f.ie&&f.win&&b.readyState!=4){var c=e.createElement("div");b.parentNode.insertBefore(c,b);c.parentNode.replaceChild(r(b),c);b.style.display="none";(function(){b.readyState==4?b.parentNode.removeChild(b):setTimeout(arguments.callee,10)})()}else b.parentNode.replaceChild(r(b),b)}function r(b){var c=
-e.createElement("div");if(f.win&&f.ie)c.innerHTML=b.innerHTML;else if(b=b.getElementsByTagName(t)[0])if(b=b.childNodes)for(var a=b.length,q=0;q<a;q++)!(b[q].nodeType==1&&b[q].nodeName=="PARAM")&&b[q].nodeType!=8&&c.appendChild(b[q].cloneNode(!0));return c}function L(b,c,a){var q,g=o(a);if(f.wk&&f.wk<312)return q;if(g){if(typeof b.id==l)b.id=a;if(f.ie&&f.win){var d="",i;for(i in b)if(b[i]!=Object.prototype[i])i.toLowerCase()=="data"?c.movie=b[i]:i.toLowerCase()=="styleclass"?d+=' class="'+b[i]+'"':
-i.toLowerCase()!="classid"&&(d+=" "+i+'="'+b[i]+'"');i="";for(var j in c)c[j]!=Object.prototype[j]&&(i+='<param name="'+j+'" value="'+c[j]+'" />');g.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+d+">"+i+"</object>";I[I.length]=b.id;q=o(b.id)}else{j=e.createElement(t);j.setAttribute("type",E);for(var m in b)b[m]!=Object.prototype[m]&&(m.toLowerCase()=="styleclass"?j.setAttribute("class",b[m]):m.toLowerCase()!="classid"&&j.setAttribute(m,b[m]));for(d in c)c[d]!=Object.prototype[d]&&
-d.toLowerCase()!="movie"&&(b=j,i=d,m=c[d],a=e.createElement("param"),a.setAttribute("name",i),a.setAttribute("value",m),b.appendChild(a));g.parentNode.replaceChild(j,g);q=j}}return q}function P(b){var c=o(b);if(c&&c.nodeName=="OBJECT")f.ie&&f.win?(c.style.display="none",function(){if(c.readyState==4){var a=o(b);if(a){for(var e in a)typeof a[e]=="function"&&(a[e]=null);a.parentNode.removeChild(a)}}else setTimeout(arguments.callee,10)}()):c.parentNode.removeChild(c)}function o(b){var c=null;try{c=e.getElementById(b)}catch(a){}return c}
-function U(b,c,a){b.attachEvent(c,a);A[A.length]=[b,c,a]}function F(b){var c=f.pv,b=b.split(".");b[0]=parseInt(b[0],10);b[1]=parseInt(b[1],10)||0;b[2]=parseInt(b[2],10)||0;return c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?!0:!1}function Q(b,c,a,d){if(!f.ie||!f.mac){var g=e.getElementsByTagName("head")[0];if(g){a=a&&typeof a=="string"?a:"screen";d&&(M=s=null);if(!s||M!=a)d=e.createElement("style"),d.setAttribute("type","text/css"),d.setAttribute("media",a),s=g.appendChild(d),
-f.ie&&f.win&&typeof e.styleSheets!=l&&e.styleSheets.length>0&&(s=e.styleSheets[e.styleSheets.length-1]),M=a;f.ie&&f.win?s&&typeof s.addRule==t&&s.addRule(b,c):s&&typeof e.createTextNode!=l&&s.appendChild(e.createTextNode(b+" {"+c+"}"))}}}function y(b,a){if(R){var e=a?"visible":"hidden";x&&o(b)?o(b).style.visibility=e:Q("#"+b,"visibility:"+e)}}function S(b){return/[\\\"<>\.;]/.exec(b)!=null&&typeof encodeURIComponent!=l?encodeURIComponent(b):b}var l="undefined",t="object",E="application/x-shockwave-flash",
-O="SWFObjectExprInst",p=window,e=document,w=navigator,T=!1,C=[function(){T?D():a()}],u=[],I=[],A=[],B,H,K,N,x=!1,G=!1,s,M,R=!0,f=function(){var b=typeof e.getElementById!=l&&typeof e.getElementsByTagName!=l&&typeof e.createElement!=l,a=w.userAgent.toLowerCase(),k=w.platform.toLowerCase(),f=k?/win/.test(k):/win/.test(a),k=k?/mac/.test(k):/mac/.test(a),a=/webkit/.test(a)?parseFloat(a.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,g=!+"\u000b1",d=[0,0,0],i=null;if(typeof w.plugins!=l&&typeof w.plugins["Shockwave Flash"]==
-t){if((i=w.plugins["Shockwave Flash"].description)&&!(typeof w.mimeTypes!=l&&w.mimeTypes[E]&&!w.mimeTypes[E].enabledPlugin))T=!0,g=!1,i=i.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),d[0]=parseInt(i.replace(/^(.*)\..*$/,"$1"),10),d[1]=parseInt(i.replace(/^.*\.(.*)\s.*$/,"$1"),10),d[2]=/[a-zA-Z]/.test(i)?parseInt(i.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}else if(typeof p.ActiveXObject!=l)try{var j=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(j&&(i=j.GetVariable("$version")))g=!0,i=i.split(" ")[1].split(","),
-d=[parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)]}catch(m){}return{w3:b,pv:d,wk:a,ie:g,win:f,mac:k}}();(function(){f.w3&&((typeof e.readyState!=l&&e.readyState=="complete"||typeof e.readyState==l&&(e.getElementsByTagName("body")[0]||e.body))&&n(),x||(typeof e.addEventListener!=l&&e.addEventListener("DOMContentLoaded",n,!1),f.ie&&f.win&&(e.attachEvent("onreadystatechange",function(){e.readyState=="complete"&&(e.detachEvent("onreadystatechange",arguments.callee),n())}),p==top&&function(){if(!x){try{e.documentElement.doScroll("left")}catch(b){setTimeout(arguments.callee,
-0);return}n()}}()),f.wk&&function(){x||(/loaded|complete/.test(e.readyState)?n():setTimeout(arguments.callee,0))}(),z(n)))})();(function(){f.ie&&f.win&&window.attachEvent("onunload",function(){for(var b=A.length,a=0;a<b;a++)A[a][0].detachEvent(A[a][1],A[a][2]);b=I.length;for(a=0;a<b;a++)P(I[a]);for(var e in f)f[e]=null;f=null;for(var d in swfobject)swfobject[d]=null;swfobject=null})})();return{registerObject:function(b,a,e,d){if(f.w3&&b&&a){var g={};g.id=b;g.swfVersion=a;g.expressInstall=e;g.callbackFn=
-d;u[u.length]=g;y(b,!1)}else d&&d({success:!1,id:b})},getObjectById:function(b){if(f.w3)return d(b)},embedSWF:function(b,a,e,d,g,v,i,p,m,o){var r={success:!1,id:a};f.w3&&!(f.wk&&f.wk<312)&&b&&a&&e&&d&&g?(y(a,!1),h(function(){e+="";d+="";var f={};if(m&&typeof m===t)for(var h in m)f[h]=m[h];f.data=b;f.width=e;f.height=d;h={};if(p&&typeof p===t)for(var s in p)h[s]=p[s];if(i&&typeof i===t)for(var n in i)typeof h.flashvars!=l?h.flashvars+="&"+n+"="+i[n]:h.flashvars=n+"="+i[n];if(F(g))s=L(f,h,a),f.id==
-a&&y(a,!0),r.success=!0,r.ref=s;else if(v&&j()){f.data=v;J(f,h,a,o);return}else y(a,!0);o&&o(r)})):o&&o(r)},switchOffAutoHideShow:function(){R=!1},ua:f,getFlashPlayerVersion:function(){return{major:f.pv[0],minor:f.pv[1],release:f.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(a,c,e){if(f.w3)return L(a,c,e)},showExpressInstall:function(a,c,e,d){f.w3&&j()&&J(a,c,e,d)},removeSWF:function(a){f.w3&&P(a)},createCSS:function(a,c,e,d){f.w3&&Q(a,c,e,d)},addDomLoadEvent:h,addLoadEvent:z,getQueryParamValue:function(a){var c=
-e.location.search||e.location.hash;if(c){/\?/.test(c)&&(c=c.split("?")[1]);if(a==null)return S(c);for(var c=c.split("&"),d=0;d<c.length;d++)if(c[d].substring(0,c[d].indexOf("="))==a)return S(c[d].substring(c[d].indexOf("=")+1))}return""},expressInstallCallback:function(){if(G){var a=o(O);if(a&&B){a.parentNode.replaceChild(B,a);if(H&&(y(H,!0),f.ie&&f.win))B.style.display="block";K&&K(N)}G=!1}}}}();(function(n){function h(){this.init()}function z(a,d){this.init(a,d)}function D(a,d){this.init(a,d)}h.capabilities=null;h.BASE_PATH="src/soundjs";h.lastId=0;h.isSupported=function(){if(SoundJS.BrowserDetect.isIOS)return!1;h.generateCapabilities();return swfobject==null?!1:swfobject.hasFlashPlayerVersion("9.0.0")};h.generateCapabilities=function(){if(h.capabilities==null)h.capabilities={panning:!0,volume:!0,mp3:!0,ogg:!1,mpeg:!0,channels:255}};h.prototype={CONTAINER_ID:"flashAudioContainer",capabilities:null,
-container:null,flash:null,flashReady:!1,flashInstances:null,flashPreloadInstances:null,queuedInstances:null,init:function(){this.capabilities=h.capabilities;this.flashInstances={};this.flashPreloadInstances={};this.queuedInstances=[];var a=this.container=document.createElement("div");a.id=this.CONTAINER_ID;a.appendChild(document.createTextNode("Default Content Here"));document.body.appendChild(a);swfobject.embedSWF(h.BASE_PATH+"FlashAudioPlugin.swf",this.CONTAINER_ID,"1","1","9.0.0",null,null,null,
-null,SoundJS.proxy(this.handleSWFReady,this))},handleSWFReady:function(a){this.flash=a.ref;this.loadTimeout=setTimeout(function(){SoundJS.proxy(this.handleTimeout,this)},2E3)},handleFlashReady:function(){this.flashReady=!0;for(var a=0,d=this.queuedInstances.length;a<d;a++)this.flash.register(this.queuedInstances[a]);this.queuedInstances=null;for(var j in this.flashPreloadInstances)this.flashPreloadInstances[j].initialize(this.flash);for(j in this.flashInstances)this.flashInstances[j].initialize(this.flash)},
-handleTimeout:function(){},register:function(a){this.flashReady?this.flash.register(a):this.queuedInstances.push(a);return{tag:new D(a,this.flash)}},create:function(a){try{var d=new z(a,this.flash);d.owner=this;return d}catch(j){}return null},registerPreloadInstance:function(a,d){this.flashPreloadInstances[a]=d},unregisterPreloadInstance:function(a){delete this.flashPreloadInstances[a]},registerSoundInstance:function(a,d){this.flashInstances[a]=d},unregisterSoundInstance:function(a){delete this.flashInstances[a]},
-handleSoundEvent:function(a,d){var j=this.flashInstances[a];if(j!=null){for(var h=[],v=2,r=arguments.length;v<r;v++)h.push(arguments[v]);try{if(h.length==0)j[d]();else j[d].apply(j,h)}catch(n){}}},handlePreloadEvent:function(a,d){var j=this.flashPreloadInstances[a];if(j!=null){for(var h=[],n=2,r=arguments.length;n<r;n++)h.push(arguments[n]);try{if(h.length==0)j[d]();else j[d].apply(j,h)}catch(z){}}},handleEvent:function(a){switch(a){case "ready":clearTimeout(this.loadTimeout),this.handleFlashReady()}},
-handleErrorEvent:function(){},toString:function(){return"[FlashPlugin]"}};n.SoundJS.FlashPlugin=h;z.prototype={src:null,uniqueId:-1,capabilities:null,flash:null,flashId:null,loop:0,volume:1,pan:0,muted:!1,paused:!1,onComplete:null,onLoop:null,onReady:null,onPlayFailed:null,onPlayInterrupted:null,init:function(a,d){this.uniqueId=h.lastId++;this.src=a;this.flash=d},initialize:function(a){this.flash=a},interrupt:function(){this.playState=SoundJS.PLAY_INTERRUPTED;if(this.onPlayInterrupted!=null)this.onPlayInterrupted(this);
-this.flash.interrupt(this.flashId);this.cleanUp()},cleanUp:function(){this.owner.unregisterSoundInstance(this.flashId);SoundJS.playFinished(this)},play:function(a,d,j,h,n,r){SoundJS.playInstance(this,a,d,j,h,n,r)},beginPlaying:function(a,d,j,h){this.loop=d;this.paused=!1;this.flashId=this.flash.playSound(this.src,a,d,j,h);if(this.flashId==null){if(this.onPlayFailed!=null)this.onPlayFailed(this);this.cleanUp();return-1}this.playState=SoundJS.PLAY_SUCCEEDED;this.owner.registerSoundInstance(this.flashId,
-this);return 1},pause:function(){this.paused=!0;return this.flash.pauseSound(this.flashId)},resume:function(){this.paused=!1;return this.flash.resumeSound(this.flashId)},stop:function(){this.playState=SoundJS.PLAY_FINISHED;this.paused=!1;var a=this.flash.stopSound(this.flashId);this.cleanUp();return a},setVolume:function(a){this.volume=a;return this.flash.setVolume(this.flashId,a)},getVolume:function(){return this.volume},mute:function(a){return(this.muted=a)?this.flash.muteSound(this.flashId):this.flash.unmuteSound(this.flashId)},
-getPan:function(){return this.pan},setPan:function(a){this.pan=a;return this.flash.setPan(this.flashId,a)},getPosition:function(){return this.flash.getPosition(this.flashId)},setPosition:function(a){return this.flash.setPosition(this.flashId,a)},getDuration:function(){return this.flash.getDuration(this.flashId)},handleSoundFinished:function(){this.playState=SoundJS.PLAY_FINISHED;if(this.onComplete!=null)this.onComplete(this);this.cleanUp()},handleLoop:function(){if(this.onLoop!=null)this.onLoop(this)},
-toString:function(){return"[FlashPlugin SoundInstance]"}};D.prototype={flash:null,src:null,flashId:null,progress:-1,readyState:0,loading:!1,onloaded:null,onprogress:null,onError:null,init:function(a,d){this.src=a;this.flash=d},initialize:function(a){this.flash=a;this.loading&&this.load(this.src)},load:function(a){if(this.flash==null)return loading=!0,!1;this.flashId=this.flash.preload(a);this.owner.registerPreloadInstance(this.flashId,this);return!0},handleProgress:function(a,d){this.progress=a/d;
-if(this.onprogress!=null)this.onprogress({loaded:a,total:d,progress:this.progress})},handleComplete:function(){this.progress=1;this.readyState=4;if(this.onloaded!=null)this.onloaded()},handleError:function(a){if(this.onerror!=null)this.onerror(a)},toString:function(){return"[FlashPlugin SoundLoader]"}}})(window);
View
29 examples/assets/tweenjs-NEXT.min.js
@@ -0,0 +1,29 @@
+/*
+* Twe