flash on 2012-5-30

by PawelGIX
♥0 | Line 28 | Modified 2012-05-30 06:48:41 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.Sprite;
     import flash.display.GradientType;
     import flash.display.Shape;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..

     
               // Create and center ellipse shape on stage
               var ellipse:Shape = new Shape();
               addChild(ellipse);
               ellipse.x = stage.stageWidth / 2;
               ellipse.y = stage.stageHeight / 2;
               
               // Set basic line style
               ellipse.graphics.lineStyle(30);
               
               // Set up gradient properties
               var colors:Array = 
                    [
                         0xFF0000,
                         0xFF6600,
                         0xFFFF00,
                         0x00FF00,
                         0x0000FF,
                         0x2E0854,
                         0x8F5E99
                    ];
               var alphas:Array = [1,1,1,1,1,1,1];
               var ratios:Array = [0,42,84,126,168,210,255];
               
               // Set gradient line style
               ellipse.graphics.lineGradientStyle(GradientType.LINEAR, colors, alphas, ratios);
               
               // Draw ellipse
               ellipse.graphics.drawEllipse(-100, -50, 200, 100);
         
     

        }
    }
}