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 2014-9-30

Get Adobe Flash player
by mutantleg 30 Sep 2014
/**
 * Copyright mutantleg ( http://wonderfl.net/user/mutantleg )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/fCLf
 */

package {
    import flash.geom.Matrix;
    import flash.display.GradientType;
    import flash.events.Event;
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
        public function FlashTest() {
     
           stage.addEventListener(Event.ENTER_FRAME, onEnter);       
        }//ctor

        public var gt:int = 0;

        public function onEnter(e:Event):void
        {
            var mx:Number;
            var my:Number;
            
            mx = stage.mouseX;
            my = stage.mouseY;

                    
            var ky:Number;
            var sy:Number;
            sy = 0;
            
            sy = my - 255;
            
            ky = 225;
            
            graphics.clear();
            graphics.lineStyle(2, 0);
            
            graphics.drawRect(0, ky-sy, 450, 2);
            
            var mat:Matrix;
            mat = new Matrix();
            mat.createGradientBox(450,450, 1.57);
            
            graphics.lineStyle();
            //graphics.beginFill(0xFF,0.1);
            graphics.beginGradientFill(GradientType.LINEAR, [0xFF,0xFFffFFff], [1,1], [0,127], mat);
            graphics.drawRect(0,0, 450,  ky-sy);
            //graphics.drawRect(0,-sy, 450,  450);
           
            graphics.endFill();
            
            graphics.beginFill(0xFF,0.7);
            graphics.drawRect(0,ky-sy,450,450);
            graphics.endFill();           
            
            var wy:Number;
            
            wy = ky - my;
            
            //graphics.drawRect(0,ky+wy,450, 8);
            
            var ang:Number;
            ang = gt *0.1;
            
            var i:int;
            var num:int;
            var t:Number;
            var ty:Number;
            num = 16;
            for (i = 0; i < num; i++)
            {
                t = (1/num)*i;
                ty = ky+(wy * t);
                
                if (i == 8)
                {
                    var tmp:Number;
                    tmp =ty-sy+Math.sin(ang)*8;
                  graphics.beginFill(0, 1);
                    graphics.drawCircle(225,tmp, 128);
                  graphics.endFill();   
                  
                  graphics.beginFill(0xFFffFF,0.15);
                   graphics.drawCircle(225-64, tmp-64, 32);
                  graphics.endFill();
                  graphics.beginFill(0xFFffFF,0.15);
                   graphics.drawCircle(225-64, tmp-64, 24);
                  graphics.endFill();
             
                }//endif
                
                graphics.beginFill(0x80, t);
                  graphics.drawRect(0,ty-sy,450, i+4);
                graphics.endFill();
                
            }//nexti
            
            
            graphics.beginFill(0, 1);
              graphics.drawRect(0, 600-sy, 450,80);
            graphics.endFill();
            
            
 
             var bx:Number;
             var by:Number;
             
                    
            graphics.lineStyle(2, 0xFFffFFff,0.5);
            for (i = 0; i < 8; i++)
            {
                bx = 200 + Math.sin(ang+i) * 8;
                by = 700+ -((gt+i*96)%400) - sy;
                
                graphics.drawCircle(bx,by, 8+Math.sin(ang+i));
                graphics.drawCircle(bx-3,by-3,2);
                
            }//nexti
            
            var k:int;
            
            graphics.lineStyle();
            for (k = 0; k < 14;k++)
            for (i = 0; i < 8; i++)
            {
              bx = 0+(k*32)+ Math.sin(ang+0.6+i*0.2+k*0.4)*8;
              by = 600-(i*16)-sy + Math.sin(k)*12;
                
              graphics.beginFill(0,0.5);
              graphics.drawRect(bx,by, 8, 16);  
              graphics.endFill();
            }//nexti
            

            gt += 1;            
        }//onenter



    }//classend
}