import flash.display.Sprite;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.events.Event;
import flash.filters.GlowFilter;
import flash.filters.BlurFilter;
import flash.display.BlendMode;
import flash.geom.ColorTransform;
[SWF(width = "900", height = "900", backgroundColor = "0x000000", frameRate = "30")]
public class FlashTest extends Sprite {
public var layer:Array = new Array();
public function FlashTest() {
layer[0] = new Bitmap(new BitmapData(stage.stageWidth, stage.stageHeight, true, 0x00000000));
layer[0].filters = [new BlurFilter(2,2,1)]
layer[1].filters = [new BlurFilter(2,2,1), new GlowFilter(0x4411ff, 1, 32, 32, 8, 3)]
addEventListener(Event.ENTER_FRAME, loop);
public function loop(e:Event):void{
var cash:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, true, 0x00000000);
cash.draw(this, null, new ColorTransform(1,1,1,0.9), BlendMode.ADD);
layer[0].bitmapData = cash;
public function lightning(tg:Sprite):void{
var th:Number = random(2) +1
tg.graphics.moveTo(xx, yy);
while(yy < stage.stageHeight){
xx += random(20) * (random(2)*2 -1);
tg.graphics.lineStyle(th,0xffffff,1);
tg.graphics.lineTo(xx,yy);