In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

Saury(sanma) PixelateEffect - TweensyFX demo

thanks to http://wonderfl.net/user/kawakita for the picture
see http://wonderfl.net/code/8a94332ed37dd4368b9e83d8cfb4e72dc613615f
Get Adobe Flash player
by mash 30 Nov 2009
/**
 * Copyright mash ( http://wonderfl.net/user/mash )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/mwHA
 */

// thanks to http://wonderfl.net/user/kawakita for the picture
// see http://wonderfl.net/code/8a94332ed37dd4368b9e83d8cfb4e72dc613615f
package {
    import flash.display.*;
    import flash.events.*;
    import flash.net.*;
    import flash.system.*;
    
    import com.flashdynamix.motion.TweensyGroup;
    import com.flashdynamix.motion.effects.PixelateEffect;
    import com.flashdynamix.motion.layers.BitmapLayer;
    import com.flashdynamix.utils.SWFProfiler;
    
    import fl.motion.easing.Linear; 

    public class PixelateFX extends Sprite {

        private var layer : BitmapLayer = new BitmapLayer(465, 465);
        private var tween : TweensyGroup = new TweensyGroup( false, true );
        private var pe    : PixelateEffect = new PixelateEffect();

        public function PixelateFX() {

            var loader :Loader = new Loader
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e:Event):void{
                doTween();
            });
            loader.load(
                new URLRequest( "http://flair4.jp/works/gohantoflash09/sanma_chan1.png" ),
                new LoaderContext( true, new ApplicationDomain() )
            );
            
            layer.draw( loader );
            layer.add(pe);
            
            addChild(layer);
        }
        private function doTween( e :Event = null ) :void {
            tween.to( pe, { amount: 1 }, 2, Linear.easeNone );
        }
    }
}