ぽこぽこ!RainbowColorの七宝模様
希望に答えて(?)
*
* @see http://tirirenge.undo.jp/?p=1766
// forked from ahchang's forked from: RainbowColorの七宝模様
// forked from ahchang's RainbowColorの七宝模様
// forked from ahchang's flash on 2009-5-1 RandomColorなCircleを並べてみた
/*
* 希望に答えて(?)
*
* @see http://tirirenge.undo.jp/?p=1766
*/
package {
import flash.display.Sprite;
[SWF(width=465, height=465, frameRate=30, backgroundColor=0xffffff)]
public class CircleNest extends Sprite
{
private var cx:int;
private var cy:int;
private var r:int=30;
public function CircleNest()
{
init();
}
private function init():void
{
for (var i:uint=0; i<12; i++)
{
cx = i*r*1.42;
for (var j:uint=0; j<12; j++)
{
cy = j*r*1.42;
var circle:Sprite = new Tama(cx,cy,r);
addChild(circle);
}
}
}
}
}
import flash.display.Sprite;
import frocessing.color.ColorHSV;
import caurina.transitions.Tweener;
class Tama extends Sprite
{
private var hsv:ColorHSV;
public function Tama(x:int,y:int,r:uint = 30 )
{
hsv = new ColorHSV(0, 1, 1, 1);
hsv.h = x+y;
this.graphics.beginFill(hsv.value);
this.graphics.drawCircle(0, 0, r);
this.graphics.endFill();
this.alpha = 0.4;
this.scaleX = 0;
this.scaleY = 0;
this.x = x;
this.y = y;
Tweener.addTween(this, {scaleY:1, scaleX:1, time:1, delay:(x+y+x+x)/400,transition:"easeOutBounce"});
}
}