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

flash on 2011-9-6

Get Adobe Flash player
by HotKarubi 05 Sep 2011
    Embed
/**
 * Copyright HotKarubi ( http://wonderfl.net/user/HotKarubi )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/dyCM
 */

package {

    import flash.display.BitmapData;
    import flash.display.BlendMode;
    import flash.display.Sprite;
    import flash.display.Bitmap;
    import flash.events.Event;
    import flash.events.KeyboardEvent;
    import flash.filters.GlowFilter;
    import flash.geom.ColorTransform;
    import flash.geom.Matrix;
    import flash.geom.Point;
    import flash.geom.Rectangle;

    [SWF(backgroundColor="#000000", width="380", height="460", frameRate="30")]

    public class Main extends Sprite
    {
        private var b:Bitmap;
        private var bd:BitmapData;
        private var mat:Matrix;
        private var seed:uint;
        
        private const point:Point = new Point();
        private var ofs:Array = [point, point];
        
        private var ct:ColorTransform;
        
        private const SIZE:int = 260;

        public function Main()
        {
            init();
        }

        private function init():void
        {
            b = new Bitmap(new BitmapData(stage.stageWidth, stage.stageHeight));
            bd = new BitmapData(stage.stageWidth, stage.stageHeight, false, 0);
            mat = new Matrix();
            seed = 0;
            ct = new ColorTransform(1, 1, 1, 1, 80 - 192, 60 - 192, 30 - 192);
            
            bd.perlinNoise(SIZE / 2, SIZE / 2, 2, 28, true, true, 0, true, ofs);
            b.bitmapData.draw(bd, null, ct);

            addChild(b);
            addEventListener(Event.ENTER_FRAME, m);
        }
        
        private function m(e:Event):void
        {
            ofs[0].x -= 3;
            ofs[0].y -= 3;
            ofs[1].x += 3;
            ofs[1].y += 3;
            bd.perlinNoise(SIZE / 2, SIZE / 2, 2, 28, true, true, 0, true, ofs);
            b.bitmapData.draw(bd, null, ct);
        }


    }

}