Code:
import hype.extended.color.ColorPool;
import hype.extended.layout.ShapeLayout;
import hype.framework.core.ObjectPool;
import hype.framework.interactive.Adjuster;
MyShape.visible = false;
var pool:ObjectPool = new ObjectPool(MyCircle,500);
var layout:ShapeLayout = new ShapeLayout(MyShape);
var color:ColorPool = new ColorPool(
0x33CCCC, 0x339999, 0x336666, 0x333399, 0x33FFCC, 0xFFCCFF, 0x33CC66, 0x99FFFF, 0x33FFFF
pool.onRequestObject = function(clip) {
clip.scaleX = clip.scaleY = (Math.random() * 0.75) + 0.25;
clip.rotation=(Math.random()*200)+5;
clip.alpha=(Math.random()*3);;
layout.applyLayout(clip);
color.colorChildren(clip);
addChild(clip);
}
pool.requestAll();
var adjuster:Adjuster = new Adjuster();
addChild(adjuster);
pool.activeSet.forEach(adjuster.add);

No comments:
Post a Comment