forked from: 初wonderfl テスト
// forked from moringo's 初wonderfl テスト
// forked from moringo's flash on 2009-2-20
package {
import flash.display.*;
import flash.events.*
import flash.utils.*;
public class FlashTest extends Sprite {
private var colorArray:Array =[0x2A95BF,0x6CBAD9,0x015CA5,0x187DC1,
0xD2D6D9,0xF2B90F,0xDFFF24,
0x85DB18,0xFF358B];
private var container:Sprite;
public function FlashTest(){
timerStart();
}
private function timerStart():void{
var timer:Timer = new Timer(1000, 1000);
timer.addEventListener(TimerEvent.TIMER, circles);
timer.start();
}
public function circles(event:TimerEvent):void {
var k:int = 0;
var j:int = 0;
var point1:int = Math.floor(Math.random()*30);
if(getChildByName("container")){
removeChild(getChildByName("container"))
}
container = new Sprite();
addChild(container);
container.name="container";
for(var i:int=0; i<800; i++){
var sp:Sprite = new Sprite();
sp.graphics.beginFill(colorArray[Math.floor(Math.random()*colorArray.length)]);
if(i%point1 == 0){
sp.graphics.drawCircle(0,0,Math.random()*10+10);
}else{
sp.graphics.drawCircle(0,0,2);
}
sp.graphics.endFill();
container.addChild(sp);
sp.x = 10 + 20 * k;
sp.y = 10 + 20*j;
k++;
if(k%30 == 0){
k=0
j++
}
}
}
}
}