forked from: Mist
// forked from Susisu's Mist
package {
import flash.filters.BlurFilter;
import flash.geom.Point;
import flash.events.Event;
import flash.display.Shape;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
[SWF(width="512",height="512",frameRate="60",backgroundColor="0x000000")]
public class FlashTest extends Sprite {
private var bmd:BitmapData;
private var bmp:Bitmap;
private var bf:BlurFilter;
private var ds:Shape;
public function FlashTest() {
bmd=new BitmapData(512,512,true,0xff000000);
bmp=new Bitmap(bmd);
addChild(bmp);
ds=new Shape();
bf=new BlurFilter(4,4,2);
addEventListener(Event.ENTER_FRAME,onEnterFrame);
}
private function onEnterFrame(e:Event):void{
ds.graphics.clear();
ds.graphics.lineStyle(1,0xe0c0f0,1);
ds.graphics.moveTo(0,256);
ds.graphics.curveTo(128+Math.random()*256>>0,Math.random()*512>>0,512,256);
bmd.draw(ds);
bmd.applyFilter(bmd,bmd.rect,new Point(),bf);
}
}
}