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

SimpleGradientCircle

Get Adobe Flash player
by bradsedito 22 Feb 2011
    Embed
/**
 * Copyright bradsedito ( http://wonderfl.net/user/bradsedito )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/jatZ
 */



//  BradSedito 2011
//  SimpleGradientCircle Class

package {
    import flash.display.*;
    import flash.geom.Matrix;
    import flash.filters.BlurFilter;
    public class SimpleGradientCircle extends Sprite 
    {
        public  var       SW  :Number     = stage.stageWidth  ;
        public  var       SH  :Number     = stage.stageHeight ;
        private var       bF  :BlurFilter = new BlurFilter( 75, 75, 3 );
        private var      mat  :Matrix                         ;
        private var   colors  :Array                          ;
        private var   alphas  :Array                          ;
        private var   ratios  :Array                          ;
        private var  circRad  :Number     = 0x100             ;
        private var     circ  :Shape      = new Shape()       ;
        
        public function SimpleGradientCircle() 
        {
            mat= new Matrix();
            colors = [0x000000,0xFFfffF];
            alphas = [1,1];
            ratios = [ 30, 150 ];  
            mat.createGradientBox( 2*(-circRad), 2*(-circRad), 0, circRad, circRad );
            circ.graphics.lineStyle();
            circ.graphics.beginGradientFill(GradientType.RADIAL,colors,alphas,ratios,mat);
            circ.graphics.drawCircle(0,0,circRad);
            circ.graphics.endFill(); 
            circ.x = SW/2;
            circ.y = SH/2;
            circ.filters = [bF];
            addChild(circ);
        }
    }
}