丸
...
@author ue
/**
* Copyright _ueueueueue ( http://wonderfl.net/user/_ueueueueue )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/mUeW
*/
package
{
import flash.display.*;
import flash.events.*;
import flash.filters.BlurFilter;
import flash.geom.*;
[SWF(width=465,height=465,backgroundColor=0xFFFFFF)]
/**
* ...
* @author ue
*/
public class Main extends Sprite
{
private const NUM:int = 70;
private const CENTER_X:int = 232 ;
private const CENTER_Y:int = 232 ;
private var circles:Vector.<Circle> = new Vector.<Circle>();
private var angle:Number = 0;
private var container:Sprite;
private var canvas:BitmapData;
private var ct:ColorTransform = new ColorTransform(1, 1, 1, 0.98);
private var blur:BlurFilter = new BlurFilter(10,10,2);
public function Main():void
{
container = new Sprite();
for (var i:int = 0; i < NUM; i++)
{
var circle:Circle = new Circle((i + 1) * ((stage.stageWidth-50) / 2 / NUM));
circle.x = CENTER_X;
circle.y = CENTER_Y;
container.addChild(circle);
circles[i] = circle;
}
canvas = new BitmapData(465, 465, false, 0x0);
var bmp:Bitmap = addChild(new Bitmap(canvas)) as Bitmap;
bmp.blendMode = BlendMode.DIFFERENCE;
addEventListener(Event.ENTER_FRAME, update);
}
private function update(e:Event):void
{
angle += .015;
for (var i:int = 0; i < NUM; i++)
{
var color:uint = (100 * (Math.sin(angle))+100) << 16 | ((128 / NUM) * (i + 1)) << 8 | (100 * (Math.cos(angle)) + 100);
var c:Circle = circles[i];
c.color = color;
var rotate:Number = c.radius / i * (i*0.1);
if (i % 4 == 0)
{
c.x = Math.cos(angle) * rotate;
c.y = Math.sin(angle) * rotate;
}
else
{
c.x = -(Math.cos(angle) * rotate);
c.y = -(Math.sin(angle) * rotate);
}
}
canvas.applyFilter(canvas, canvas.rect, new Point(), blur);
canvas.colorTransform(canvas.rect, ct);
canvas.draw(container,new Matrix(1,0,0,1,CENTER_X,CENTER_Y));
}
}
}
import flash.display.Sprite;
class Circle extends Sprite
{
public var radius:Number;
private var _color:uint = 0xffffff;
public function Circle(radius:Number)
{
this.radius = radius;
draw();
}
public function get color():uint { return _color; }
public function set color(value:uint):void
{
_color = value;
draw();
}
private function draw():void
{
graphics.clear();
graphics.lineStyle(0,_color,.3);
graphics.drawCircle(0, 0, this.radius);
}
}