(function (cjs, an) {

var p; // shortcut to reference prototypes
var lib={};var ss={};var img={};
lib.ssMetadata = [
		{name:"baby_piston2_sam_atlas_1", frames: [[0,0,917,1299],[919,0,917,1299]]},
		{name:"baby_piston2_sam_atlas_2", frames: [[0,0,917,1299],[919,0,917,1299]]},
		{name:"baby_piston2_sam_atlas_3", frames: [[0,0,917,1299],[919,0,917,1299]]},
		{name:"baby_piston2_sam_atlas_4", frames: [[0,0,917,1299],[919,0,917,1299]]},
		{name:"baby_piston2_sam_atlas_5", frames: [[0,0,917,1299],[919,0,917,1299]]},
		{name:"baby_piston2_sam_atlas_6", frames: [[0,0,917,1299],[919,0,917,1299]]},
		{name:"baby_piston2_sam_atlas_7", frames: [[0,0,917,1299],[919,0,917,1299]]},
		{name:"baby_piston2_sam_atlas_8", frames: [[0,0,917,1299],[919,0,917,1299]]},
		{name:"baby_piston2_sam_atlas_9", frames: [[0,1301,596,180],[0,0,917,1299]]}
];


(lib.AnMovieClip = function(){
	this.actionFrames = [];
	this.ignorePause = false;
	this.currentSoundStreamInMovieclip;
	this.soundStreamDuration = new Map();
	this.streamSoundSymbolsList = [];

	this.gotoAndPlayForStreamSoundSync = function(positionOrLabel){
		cjs.MovieClip.prototype.gotoAndPlay.call(this,positionOrLabel);
	}
	this.gotoAndPlay = function(positionOrLabel){
		this.clearAllSoundStreams();
		var pos = this.timeline.resolve(positionOrLabel);
		if (pos != null) { this.startStreamSoundsForTargetedFrame(pos); }
		cjs.MovieClip.prototype.gotoAndPlay.call(this,positionOrLabel);
	}
	this.play = function(){
		this.clearAllSoundStreams();
		this.startStreamSoundsForTargetedFrame(this.currentFrame);
		cjs.MovieClip.prototype.play.call(this);
	}
	this.gotoAndStop = function(positionOrLabel){
		cjs.MovieClip.prototype.gotoAndStop.call(this,positionOrLabel);
		this.clearAllSoundStreams();
	}
	this.stop = function(){
		cjs.MovieClip.prototype.stop.call(this);
		this.clearAllSoundStreams();
	}
	this.startStreamSoundsForTargetedFrame = function(targetFrame){
		for(var index=0; index<this.streamSoundSymbolsList.length; index++){
			if(index <= targetFrame && this.streamSoundSymbolsList[index] != undefined){
				for(var i=0; i<this.streamSoundSymbolsList[index].length; i++){
					var sound = this.streamSoundSymbolsList[index][i];
					if(sound.endFrame > targetFrame){
						var targetPosition = Math.abs((((targetFrame - sound.startFrame)/lib.properties.fps) * 1000));
						var instance = playSound(sound.id);
						var remainingLoop = 0;
						if(sound.offset){
							targetPosition = targetPosition + sound.offset;
						}
						else if(sound.loop > 1){
							var loop = targetPosition /instance.duration;
							remainingLoop = Math.floor(sound.loop - loop);
							if(targetPosition == 0){ remainingLoop -= 1; }
							targetPosition = targetPosition % instance.duration;
						}
						instance.loop = remainingLoop;
						instance.position = Math.round(targetPosition);
						this.InsertIntoSoundStreamData(instance, sound.startFrame, sound.endFrame, sound.loop , sound.offset);
					}
				}
			}
		}
	}
	this.InsertIntoSoundStreamData = function(soundInstance, startIndex, endIndex, loopValue, offsetValue){ 
 		this.soundStreamDuration.set({instance:soundInstance}, {start: startIndex, end:endIndex, loop:loopValue, offset:offsetValue});
	}
	this.clearAllSoundStreams = function(){
		this.soundStreamDuration.forEach(function(value,key){
			key.instance.stop();
		});
 		this.soundStreamDuration.clear();
		this.currentSoundStreamInMovieclip = undefined;
	}
	this.stopSoundStreams = function(currentFrame){
		if(this.soundStreamDuration.size > 0){
			var _this = this;
			this.soundStreamDuration.forEach(function(value,key,arr){
				if((value.end) == currentFrame){
					key.instance.stop();
					if(_this.currentSoundStreamInMovieclip == key) { _this.currentSoundStreamInMovieclip = undefined; }
					arr.delete(key);
				}
			});
		}
	}

	this.computeCurrentSoundStreamInstance = function(currentFrame){
		if(this.currentSoundStreamInMovieclip == undefined){
			var _this = this;
			if(this.soundStreamDuration.size > 0){
				var maxDuration = 0;
				this.soundStreamDuration.forEach(function(value,key){
					if(value.end > maxDuration){
						maxDuration = value.end;
						_this.currentSoundStreamInMovieclip = key;
					}
				});
			}
		}
	}
	this.getDesiredFrame = function(currentFrame, calculatedDesiredFrame){
		for(var frameIndex in this.actionFrames){
			if((frameIndex > currentFrame) && (frameIndex < calculatedDesiredFrame)){
				return frameIndex;
			}
		}
		return calculatedDesiredFrame;
	}

	this.syncStreamSounds = function(){
		this.stopSoundStreams(this.currentFrame);
		this.computeCurrentSoundStreamInstance(this.currentFrame);
		if(this.currentSoundStreamInMovieclip != undefined){
			var soundInstance = this.currentSoundStreamInMovieclip.instance;
			if(soundInstance.position != 0){
				var soundValue = this.soundStreamDuration.get(this.currentSoundStreamInMovieclip);
				var soundPosition = (soundValue.offset?(soundInstance.position - soundValue.offset): soundInstance.position);
				var calculatedDesiredFrame = (soundValue.start)+((soundPosition/1000) * lib.properties.fps);
				if(soundValue.loop > 1){
					calculatedDesiredFrame +=(((((soundValue.loop - soundInstance.loop -1)*soundInstance.duration)) / 1000) * lib.properties.fps);
				}
				calculatedDesiredFrame = Math.floor(calculatedDesiredFrame);
				var deltaFrame = calculatedDesiredFrame - this.currentFrame;
				if((deltaFrame >= 0) && this.ignorePause){
					cjs.MovieClip.prototype.play.call(this);
					this.ignorePause = false;
				}
				else if(deltaFrame >= 2){
					this.gotoAndPlayForStreamSoundSync(this.getDesiredFrame(this.currentFrame,calculatedDesiredFrame));
				}
				else if(deltaFrame <= -2){
					cjs.MovieClip.prototype.stop.call(this);
					this.ignorePause = true;
				}
			}
		}
	}
}).prototype = p = new cjs.MovieClip();
// symbols:



(lib.CachedBmp_1 = function() {
	this.initialize(ss["baby_piston2_sam_atlas_9"]);
	this.gotoAndStop(0);
}).prototype = p = new cjs.Sprite();



(lib.babypistonup01 = function() {
	this.initialize(ss["baby_piston2_sam_atlas_1"]);
	this.gotoAndStop(0);
}).prototype = p = new cjs.Sprite();



(lib.babypistonup02 = function() {
	this.initialize(ss["baby_piston2_sam_atlas_1"]);
	this.gotoAndStop(1);
}).prototype = p = new cjs.Sprite();



(lib.babypistonup03 = function() {
	this.initialize(ss["baby_piston2_sam_atlas_2"]);
	this.gotoAndStop(0);
}).prototype = p = new cjs.Sprite();



(lib.babypistonup04 = function() {
	this.initialize(ss["baby_piston2_sam_atlas_2"]);
	this.gotoAndStop(1);
}).prototype = p = new cjs.Sprite();



(lib.babypistonup05 = function() {
	this.initialize(ss["baby_piston2_sam_atlas_3"]);
	this.gotoAndStop(0);
}).prototype = p = new cjs.Sprite();



(lib.babypistonup06 = function() {
	this.initialize(ss["baby_piston2_sam_atlas_3"]);
	this.gotoAndStop(1);
}).prototype = p = new cjs.Sprite();



(lib.babypistonup07 = function() {
	this.initialize(ss["baby_piston2_sam_atlas_4"]);
	this.gotoAndStop(0);
}).prototype = p = new cjs.Sprite();



(lib.babypiston01 = function() {
	this.initialize(ss["baby_piston2_sam_atlas_4"]);
	this.gotoAndStop(1);
}).prototype = p = new cjs.Sprite();



(lib.babypiston02 = function() {
	this.initialize(ss["baby_piston2_sam_atlas_5"]);
	this.gotoAndStop(0);
}).prototype = p = new cjs.Sprite();



(lib.babypiston03 = function() {
	this.initialize(ss["baby_piston2_sam_atlas_5"]);
	this.gotoAndStop(1);
}).prototype = p = new cjs.Sprite();



(lib.babypiston04 = function() {
	this.initialize(ss["baby_piston2_sam_atlas_6"]);
	this.gotoAndStop(0);
}).prototype = p = new cjs.Sprite();



(lib.babypiston05 = function() {
	this.initialize(ss["baby_piston2_sam_atlas_6"]);
	this.gotoAndStop(1);
}).prototype = p = new cjs.Sprite();



(lib.babypiston06 = function() {
	this.initialize(ss["baby_piston2_sam_atlas_7"]);
	this.gotoAndStop(0);
}).prototype = p = new cjs.Sprite();



(lib.babypiston07 = function() {
	this.initialize(ss["baby_piston2_sam_atlas_7"]);
	this.gotoAndStop(1);
}).prototype = p = new cjs.Sprite();



(lib.babypiston08 = function() {
	this.initialize(ss["baby_piston2_sam_atlas_8"]);
	this.gotoAndStop(0);
}).prototype = p = new cjs.Sprite();



(lib.babypiston09 = function() {
	this.initialize(ss["baby_piston2_sam_atlas_8"]);
	this.gotoAndStop(1);
}).prototype = p = new cjs.Sprite();



(lib.babypiston10 = function() {
	this.initialize(ss["baby_piston2_sam_atlas_9"]);
	this.gotoAndStop(1);
}).prototype = p = new cjs.Sprite();



// stage content:
(lib.babypiston2sam = function(mode,startPosition,loop,reversed) {
if (loop == null) { loop = true; }
if (reversed == null) { reversed = false; }
	var props = new Object();
	props.mode = mode;
	props.startPosition = startPosition;
	props.labels = {};
	props.loop = loop;
	props.reversed = reversed;
	cjs.MovieClip.apply(this,[props]);

	this.actionFrames = [0,54,61];
	this.streamSoundSymbolsList[0] = [{id:"babypiston",startFrame:0,endFrame:54,loop:1,offset:0},{id:"babyikigire",startFrame:0,endFrame:59,loop:1,offset:0}];
	this.streamSoundSymbolsList[54] = [{id:"babypiston2",startFrame:54,endFrame:77,loop:1,offset:0}];
	this.streamSoundSymbolsList[61] = [{id:"babyikigire2",startFrame:61,endFrame:77,loop:1,offset:0}];
	// timeline functions:
	this.frame_0 = function() {
		this.clearAllSoundStreams();
		 
		var soundInstance = playSound("babyikigire",0);
		this.InsertIntoSoundStreamData(soundInstance,0,59,1);
		var soundInstance = playSound("babypiston",0);
		this.InsertIntoSoundStreamData(soundInstance,0,54,1);
	}
	this.frame_54 = function() {
		var soundInstance = playSound("babypiston2",0);
		this.InsertIntoSoundStreamData(soundInstance,54,77,1);
	}
	this.frame_61 = function() {
		var soundInstance = playSound("babyikigire2",0);
		this.InsertIntoSoundStreamData(soundInstance,61,77,1);
	}

	// actions tween:
	this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(54).call(this.frame_54).wait(7).call(this.frame_61).wait(16));

	// レイヤー_4
	this.instance = new lib.CachedBmp_1();
	this.instance.setTransform(26,549,0.5,0.5);

	this.timeline.addTween(cjs.Tween.get(this.instance).wait(77));

	// レイヤー_1
	this.instance_1 = new lib.babypiston01();
	this.instance_1.setTransform(10,10,0.4996,0.4996);

	this.instance_2 = new lib.babypiston02();
	this.instance_2.setTransform(10,10,0.4996,0.4996);

	this.instance_3 = new lib.babypiston03();
	this.instance_3.setTransform(10,10,0.4996,0.4996);

	this.instance_4 = new lib.babypiston04();
	this.instance_4.setTransform(10,10,0.4996,0.4996);

	this.instance_5 = new lib.babypiston05();
	this.instance_5.setTransform(10,10,0.4996,0.4996);

	this.instance_6 = new lib.babypiston06();
	this.instance_6.setTransform(10,10,0.4996,0.4996);

	this.instance_7 = new lib.babypiston07();
	this.instance_7.setTransform(10,10,0.4996,0.4996);

	this.instance_8 = new lib.babypiston08();
	this.instance_8.setTransform(10,10,0.4996,0.4996);

	this.instance_9 = new lib.babypiston09();
	this.instance_9.setTransform(10,10,0.4996,0.4996);

	this.instance_10 = new lib.babypiston10();
	this.instance_10.setTransform(10,10,0.4996,0.4996);

	this.instance_11 = new lib.babypistonup01();
	this.instance_11.setTransform(10,10,0.4996,0.4996);

	this.instance_12 = new lib.babypistonup02();
	this.instance_12.setTransform(10,10,0.4996,0.4996);

	this.instance_13 = new lib.babypistonup03();
	this.instance_13.setTransform(10,10,0.4996,0.4996);

	this.instance_14 = new lib.babypistonup04();
	this.instance_14.setTransform(10,10,0.4996,0.4996);

	this.instance_15 = new lib.babypistonup05();
	this.instance_15.setTransform(10,10,0.4996,0.4996);

	this.instance_16 = new lib.babypistonup06();
	this.instance_16.setTransform(10,10,0.4996,0.4996);

	this.instance_17 = new lib.babypistonup07();
	this.instance_17.setTransform(10,10,0.4996,0.4996);

	this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.instance_1}]}).to({state:[{t:this.instance_2}]},2).to({state:[{t:this.instance_3}]},1).to({state:[{t:this.instance_4}]},1).to({state:[{t:this.instance_5}]},1).to({state:[{t:this.instance_6}]},2).to({state:[{t:this.instance_7}]},2).to({state:[{t:this.instance_8}]},2).to({state:[{t:this.instance_9}]},2).to({state:[{t:this.instance_10}]},2).to({state:[{t:this.instance_1}]},2).to({state:[{t:this.instance_2}]},2).to({state:[{t:this.instance_3}]},1).to({state:[{t:this.instance_4}]},1).to({state:[{t:this.instance_5}]},1).to({state:[{t:this.instance_6}]},2).to({state:[{t:this.instance_7}]},2).to({state:[{t:this.instance_8}]},2).to({state:[{t:this.instance_9}]},2).to({state:[{t:this.instance_10}]},2).to({state:[{t:this.instance_1}]},2).to({state:[{t:this.instance_2}]},2).to({state:[{t:this.instance_3}]},1).to({state:[{t:this.instance_4}]},1).to({state:[{t:this.instance_5}]},1).to({state:[{t:this.instance_6}]},2).to({state:[{t:this.instance_7}]},2).to({state:[{t:this.instance_8}]},2).to({state:[{t:this.instance_9}]},2).to({state:[{t:this.instance_10}]},2).to({state:[{t:this.instance_1}]},2).to({state:[{t:this.instance_2}]},2).to({state:[{t:this.instance_3}]},1).to({state:[{t:this.instance_11}]},1).to({state:[{t:this.instance_12}]},1).to({state:[{t:this.instance_13}]},1).to({state:[{t:this.instance_14}]},2).to({state:[{t:this.instance_15}]},2).to({state:[{t:this.instance_16}]},2).to({state:[{t:this.instance_17}]},2).to({state:[{t:this.instance_6}]},2).to({state:[{t:this.instance_7}]},2).to({state:[{t:this.instance_8}]},2).to({state:[{t:this.instance_9}]},2).to({state:[{t:this.instance_10}]},2).wait(2));

	this._renderFirstFrame();

}).prototype = p = new lib.AnMovieClip();
p.nominalBounds = new cjs.Rectangle(249.5,344.5,218.7,314.5);
// library properties:
lib.properties = {
	id: '9E4AE608BCE28F42935D56525653A541',
	width: 479,
	height: 669,
	fps: 24,
	color: "#000000",
	opacity: 1.00,
	manifest: [
		{src:"images/baby_piston2_sam_atlas_1.png", id:"baby_piston2_sam_atlas_1"},
		{src:"images/baby_piston2_sam_atlas_2.png", id:"baby_piston2_sam_atlas_2"},
		{src:"images/baby_piston2_sam_atlas_3.png", id:"baby_piston2_sam_atlas_3"},
		{src:"images/baby_piston2_sam_atlas_4.png", id:"baby_piston2_sam_atlas_4"},
		{src:"images/baby_piston2_sam_atlas_5.png", id:"baby_piston2_sam_atlas_5"},
		{src:"images/baby_piston2_sam_atlas_6.png", id:"baby_piston2_sam_atlas_6"},
		{src:"images/baby_piston2_sam_atlas_7.png", id:"baby_piston2_sam_atlas_7"},
		{src:"images/baby_piston2_sam_atlas_8.png", id:"baby_piston2_sam_atlas_8"},
		{src:"images/baby_piston2_sam_atlas_9.png", id:"baby_piston2_sam_atlas_9"},
		{src:"sounds/babyikigire.mp3", id:"babyikigire"},
		{src:"sounds/babyikigire2.mp3", id:"babyikigire2"},
		{src:"sounds/babypiston.mp3", id:"babypiston"},
		{src:"sounds/babypiston2.mp3", id:"babypiston2"}
	],
	preloads: []
};



// bootstrap callback support:

(lib.Stage = function(canvas) {
	createjs.Stage.call(this, canvas);
}).prototype = p = new createjs.Stage();

p.setAutoPlay = function(autoPlay) {
	this.tickEnabled = autoPlay;
}
p.play = function() { this.tickEnabled = true; this.getChildAt(0).gotoAndPlay(this.getTimelinePosition()) }
p.stop = function(ms) { if(ms) this.seek(ms); this.tickEnabled = false; }
p.seek = function(ms) { this.tickEnabled = true; this.getChildAt(0).gotoAndStop(lib.properties.fps * ms / 1000); }
p.getDuration = function() { return this.getChildAt(0).totalFrames / lib.properties.fps * 1000; }

p.getTimelinePosition = function() { return this.getChildAt(0).currentFrame / lib.properties.fps * 1000; }

an.bootcompsLoaded = an.bootcompsLoaded || [];
if(!an.bootstrapListeners) {
	an.bootstrapListeners=[];
}

an.bootstrapCallback=function(fnCallback) {
	an.bootstrapListeners.push(fnCallback);
	if(an.bootcompsLoaded.length > 0) {
		for(var i=0; i<an.bootcompsLoaded.length; ++i) {
			fnCallback(an.bootcompsLoaded[i]);
		}
	}
};

an.compositions = an.compositions || {};
an.compositions['9E4AE608BCE28F42935D56525653A541'] = {
	getStage: function() { return exportRoot.stage; },
	getLibrary: function() { return lib; },
	getSpriteSheet: function() { return ss; },
	getImages: function() { return img; }
};

an.compositionLoaded = function(id) {
	an.bootcompsLoaded.push(id);
	for(var j=0; j<an.bootstrapListeners.length; j++) {
		an.bootstrapListeners[j](id);
	}
}

an.getComposition = function(id) {
	return an.compositions[id];
}


an.makeResponsive = function(isResp, respDim, isScale, scaleType, domContainers) {		
	var lastW, lastH, lastS=1;		
	window.addEventListener('resize', resizeCanvas);		
	resizeCanvas();		
	function resizeCanvas() {			
		var w = lib.properties.width, h = lib.properties.height;			
		var iw = window.innerWidth, ih=window.innerHeight;			
		var pRatio = window.devicePixelRatio || 1, xRatio=iw/w, yRatio=ih/h, sRatio=1;			
		if(isResp) {                
			if((respDim=='width'&&lastW==iw) || (respDim=='height'&&lastH==ih)) {                    
				sRatio = lastS;                
			}				
			else if(!isScale) {					
				if(iw<w || ih<h)						
					sRatio = Math.min(xRatio, yRatio);				
			}				
			else if(scaleType==1) {					
				sRatio = Math.min(xRatio, yRatio);				
			}				
			else if(scaleType==2) {					
				sRatio = Math.max(xRatio, yRatio);				
			}			
		}
		domContainers[0].width = w * pRatio * sRatio;			
		domContainers[0].height = h * pRatio * sRatio;
		domContainers.forEach(function(container) {				
			container.style.width = w * sRatio + 'px';				
			container.style.height = h * sRatio + 'px';			
		});
		stage.scaleX = pRatio*sRatio;			
		stage.scaleY = pRatio*sRatio;
		lastW = iw; lastH = ih; lastS = sRatio;            
		stage.tickOnUpdate = false;            
		stage.update();            
		stage.tickOnUpdate = true;		
	}
}
an.handleSoundStreamOnTick = function(event) {
	if(!event.paused){
		var stageChild = stage.getChildAt(0);
		if(!stageChild.paused || stageChild.ignorePause){
			stageChild.syncStreamSounds();
		}
	}
}
an.handleFilterCache = function(event) {
	if(!event.paused){
		var target = event.target;
		if(target){
			if(target.filterCacheList){
				for(var index = 0; index < target.filterCacheList.length ; index++){
					var cacheInst = target.filterCacheList[index];
					if((cacheInst.startFrame <= target.currentFrame) && (target.currentFrame <= cacheInst.endFrame)){
						cacheInst.instance.cache(cacheInst.x, cacheInst.y, cacheInst.w, cacheInst.h);
					}
				}
			}
		}
	}
}


})(createjs = createjs||{}, AdobeAn = AdobeAn||{});
var createjs, AdobeAn;