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

137.50776...( 2 )

Get Adobe Flash player
by 0xABCDEF 17 Apr 2011
/**
 * Copyright 0xABCDEF ( http://wonderfl.net/user/0xABCDEF )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/chtc
 */

// forked from Blue_fox_and_red_grape's 137.50776...
package {
    import gs.TweenLite;
    import flash.display.BitmapData;
    import flash.display.Bitmap;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.geom.Point;
    public class _13750776 extends Sprite {
        public function _13750776() {
            var sw:int = stage.stageWidth;
            var sh:int = stage.stageHeight;
            var display:Bitmap = addChild( new Bitmap( new BitmapData( sw, sh, false ) ) ) as Bitmap;
            var canvas:BitmapData = display.bitmapData;
            
            var angle:Number = 137.50776*Math.PI/180;
            var currentAngle:Number = 0;
            var target:Point;
            var particles:Array = [];
            
            var num:int = 10000;
            
            var len:Number = sw/2;
            for( var i:int=0; i<num; ++i )
            {
                target = Point.polar( len-= sw/2/num *i/num*2, currentAngle += angle );
                particles.push( { x:sw/2, y:sh/2, c:-i/num } );
                TweenLite.to( particles[ particles.length-1 ], 1, { delay:0.002*i, x:sw/2+target.x, y:sh/2+target.y } );
            }
            
            function draw( e:Event ):void
            {
                canvas.fillRect( canvas.rect, 0 );
                for( var i:int=0; i<particles.length; ++i )
                {
                    canvas.setPixel( particles[ i ].x, particles[ i ].y, particles[ i ].c * 0xFFFFFF );
                }
            }
            
            addEventListener( Event.ENTER_FRAME, draw );
        }
    }
}