Chapter 36 Example 14 actionscript.. forked:1favorite:1lines:37license : MIT License modified : 2010-02-09 15:02:01 Embed Tweet package { import flash.display.*; import flash.events.Event; import flash.filters.BlurFilter; import flash.geom.Point; import flash.net.URLRequest; import flash.system.LoaderContext; [SWF(frameRate="24", backgroundColor="#000000")] public class ch36ex14 extends Sprite { protected var bmp:BitmapData; protected var seed:int; protected var image:Loader; public function ch36ex14() { image = new Loader(); addChild(image); image.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoad); image.load( new URLRequest("http://actionscriptbible.com/files/caviar.jpg"), new LoaderContext(true) ); } protected function onLoad(event:Event):void { var src:BitmapData = Bitmap(image.content).bitmapData; bmp = new BitmapData(src.width, src.height, true); var bitmap:Bitmap = new Bitmap(bmp); addChild(bitmap); bitmap.blendMode = BlendMode.MULTIPLY; addEventListener(Event.ENTER_FRAME, onEnterFrame); } protected function onEnterFrame(event:Event):void { bmp.fillRect(bmp.rect, 0); bmp.noise(++seed, 200, 255, BitmapDataChannel.BLUE, true); bmp.applyFilter(bmp, bmp.rect, new Point(), new BlurFilter(4, 4, 2)); image.alpha = (seed % 2)? 0.95 : 1; } } } Code Fullscreen Preview Fullscreen FTMSuperfly as3bible bitmap bitmapdata noise blendMode BlendMode.MULTIPLY noise BitmapDataChannel.BLUE content height Bitmap width LoaderContext alpha rect bitmapData Loader fillRect Event.COMPLETE applyFilter addEventListener addChild BitmapData load sort new page view favorite forked pv157 forked from: Chapter 36 Exampl.. Aksor.Al forked:0 favorite:0lines:37 (diff:3)