forked from: forked from: forked from: Snow Version MSMS
Snow.as
色を変えてみただけですー
// forked from ryownet's forked from: forked from: Snow Version MSMS
// forked from 0105's forked from: Snow Version MSMS
// forked from kadal's Snow Version MSMS
// forked from kadal's Snow
/* Snow.as */
//色を変えてみただけですー
package {
import flash.display.Sprite;
import flash.display.Graphics;
import flash.display.DisplayObject;
import flash.events.TimerEvent;
import flash.utils.Timer;
import flash.events.Event;
import flash.filters.BlurFilter;
[SWF(backgroundColor="#000000", frameRate=60)]
public class Snow extends Sprite {
public function Snow() {
var timer:Timer = new Timer(10, 0);
timer.addEventListener(TimerEvent.TIMER, myCircle);
timer.start();
}
private function myCircle(evt:TimerEvent):void {
var p:Sprite = new Sprite();
p.graphics.beginFill(Math.random()*0xffffff);
p.graphics.drawCircle(0, 0, Math.random()*30);
p.x = Math.random() * stage.stageWidth;
p.y = Math.random() * stage.stageHeight;
p.graphics.endFill();
var filters_array:Array = new Array();
var myBlur:BlurFilter = new BlurFilter(4, 4, 1);
filters_array.push(myBlur);
p.filters = filters_array;
p.alpha = 0.1;
addChild(p);
p.addEventListener(Event.ENTER_FRAME, smaller);
}
private function smaller(evt:Event):void{
var p:Object = evt.target;
p.scaleX *= 0.9;
p.scaleY *= 0.9
p.alpha = 1 - p.scaleX*0.9 + 0.1;
p.x += ((stage.stageWidth/2)-p.x)/32;
p.y += ((stage.stageHeight/2)-p.y)/64;
if(p.width < 1){
p.visible = false;
p.removeEventListener(Event.ENTER_FRAME, smaller);
removeChild(DisplayObject(p));
}
}
}
}