flash 模糊的mask效果
-
- var image:Loader = new Loader();
- image.cacheAsBitmap = true;
- addChild(image);
- image.load(new URLRequest("/UploadTeach/200901/20090116172551237.jpg"));
-
-
- var loader:Loader = new Loader();
- loader.contentLoaderInfo.addEventListener(Event.COMPLETE,complete)
- loader.filters = [new BlurFilter(0,0,0)]
- addChild(loader)
- loader.load(new URLRequest("/UploadTeach/200901/20090116172553577.png"));
-
-
- image.mask = loader;
-
-
- addChild(s);
- s.addEventListener(Event.CHANGE,change);
- function change(e:Event):void
- {
- loader.filters = [new BlurFilter(s.value,s.value,s.value)]
- }
-
-
-
-
- function complete(e:Event):void
- {
- var bit:BitmapData = Bitmap(loader.content).bitmapData.clone();
- var bmp:Bitmap = new Bitmap(bit);
- bmp.x = 256;
- addChild(bmp);
- }
补充:flash教程,As3.0