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 2011-6-5

/**
 * Copyright bradsedito ( http://wonderfl.net/user/bradsedito )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/sbny
 */

// forked from amdmamdma's flash on 2011-6-5
package {
    import flash.geom.ColorTransform;
    import flash.events.*;
    import flash.filters.BlurFilter;
    import flash.display.Bitmap;
    import flash.display.BitmapData; 
    import flash.geom.Matrix;
    import flash.display.Graphics;
    import flash.display.Sprite;
    import com.greensock.*;
    import com.greensock.easing.*;
    
    public class Orb extends Sprite 
    {
        public const mX:Number = new Number(stage.mouseX);
        public const mY:Number = new Number(stage.mouseY);

        public function Orb() 
        {
            var size:uint = 100;
            var sp02:Sprite = new Sprite();
            var gr02:Graphics = sp02.graphics;
            var sp01:Sprite = new Sprite();
            var gr01:Graphics = sp01.graphics;
            var colors:Array = [0xffffff, 0x0000ff];
            var alphas:Array = [1, 0];
            var ratios:Array = [0, 255];
            var mtr01:Matrix = new Matrix();
            
            stage.addEventListener(Event.ADDED_TO_STAGE, UIhandler);
 
            gr02.beginFill(0x000000);
            gr02.drawRect(0, 0, 500, 500);
            gr02.endFill();
            addChild(sp02);
            mtr01.createGradientBox(size, size);
            gr01.beginGradientFill("radial", colors, alphas, ratios, mtr01);
            gr01.drawCircle(size * 0.5, size * 0.5, size * 0.5);
            gr01.endFill();
             
            var bd03:BitmapData = new BitmapData(sp01.width, sp01.height, true, 0x00000000);
            var bm03:Bitmap = new Bitmap(bd03);
            bd03.draw(sp01);
            addChild(bm03);

            var bd04:BitmapData = bd03.clone();
            var bm04:Bitmap = new Bitmap(bd04);
            bd04.colorTransform(bd04.rect, new ColorTransform(1.5) );
            bm04.filters = [new BlurFilter(40, 40)]
            bm04.blendMode = "add";
            addChild(bm04);       

    function UIhandler(event:Event):void
    {
         TweenMax.to(this, 1, {x:mX, y:mY, ease:Quad.easeInOut});
    }
            
            
        }
    }
}