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

forked from: flash on 2012-1-7

Get Adobe Flash player
by zaxari4 08 Jan 2012
/**
 * Copyright zaxari4 ( http://wonderfl.net/user/zaxari4 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/k2xQ
 */

// forked from christian's flash on 2012-1-7
package
{
    import flash.geom.*;
    import flash.display.*;
    import flash.events.Event;
    import flash.utils.getTimer;

    import frocessing.color.ColorHSV;

    [ SWF (width = '465', height = '465', backgroundColor = '0xFFFFFF', frameRate = '30')]

    public class FlashTest extends Sprite
    {
        private var e : BitmapData = new BitmapData (233,  233, true, 0x00);
        private var s : BitmapData = new BitmapData (465,  465, true, 0x00);
        private var m : Matrix = new Matrix (2, 0, 0, 2, 0, 0);
        private var o : Array = [new Point (), new Point ()];
        private var c : ColorHSV = new ColorHSV ();
        private var t : Number;

        public function FlashTest ()
        {
            Wonderfl.disable_capture ();
            stage.scaleMode = 'noScale';

            addChild (new Bitmap (s));
            addEventListener (Event.ENTER_FRAME, setRender);
        }

        private function setRender ($ : Event) : void
        {
            t = getTimer ();

            o[1].x =- (o[0].x = Math.cos (t * 0.00005) * 1000);
            o[1].y =- (o[0].y = Math.sin (t * 0.00005) * 1000);

            e.perlinNoise (100, 100, 2, 0xAAA, false, false, 8, false, o);
            e.paletteMap (e, e.rect, e.rect.topLeft, null, null, null, a);

            s.draw (e, m, null, null, null, true);
        }

        private function map () : Array
        {
            a = [];

            for (var i : int = 0x00; i < 0xFF; i++) { a.push (c.value32); c.h += 0x05; }

            return a;
        }
        
        private var a : Array = map ();
    }
}