import hype.extended.behavior.FixedVibration;
import hype.extended.color.ColorPool;
import hype.extended.layout.ShapeLayout;
import hype.framework.core.ObjectPool;
import hype.framework.core.TimeType;
import hype.framework.display.BitmapCanvas;
import hype.framework.rhythm.SimpleRhythm;
MyShape.visible = false;
var myWidth = stage.stageWidth;
var myHeight = stage.stageHeight;
var bmc:BitmapCanvas = new BitmapCanvas(myWidth, myHeight);
addChild(bmc);
var clipContainer:Sprite = new Sprite();
var colorPool:ColorPool = new ColorPool(
0x587b7C, 0x719b9E, 0x9FC1BE, 0xE0D9BB, 0xDACB94, 0xCABA88, 0xDABD55, 0xC49F32, 0xA97409
);
var pool:ObjectPool = new ObjectPool(MyCircle, 100);
var layout:ShapeLayout = new ShapeLayout(MyShape);
function addNextClip(r:SimpleRhythm) {
if (pool.isFull) {
rhythm.stop();
} else {
pool.request();
}
}
pool.onRequestObject = function(clip) {
clip.scaleX = clip.scaleY = 0;
layout.applyLayout(clip);
colorPool.colorChildren(clip);
clipContainer.addChild(clip);
// object, property, spring, ease, min, max, isRelative
var yVib:FixedVibration = new FixedVibration(clip, “y”, 0.99, 0.004, -80, 80, true);
var sVib:FixedVibration = new FixedVibration(clip, “scale”, 0.99, 0.03, 0.0, 0.2, false);
yVib.start();
sVib.start();
}
var rhythm = new SimpleRhythm(addNextClip);
rhythm.start(TimeType.TIME, 250);
bmc.startCapture(clipContainer, true);