Applying Gradients to Lines : Gradient : Graphics Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Graphics » Gradient »

 

Applying Gradients to Lines


 
package
{
    import flash.display.*;
    import flash.geom.Matrix;
    public class Main extends Sprite
    {
        public function Main ()
        {
            var shape:Sprite = new Sprite();
            shape.x = 100;
            shape.y = 100;
    
            var mxBox:Matrix = new Matrix();
            mxBox.createGradientBox(200200);
    
            shape.graphics.lineStyle(25);
    
            shape.graphics.lineGradientStyle(GradientType.LINEAR,[0xFFFF000x00FFFF][100100][0x000xFF], mxBox);
            shape.graphics.curveTo(200, -1004000);
            shape.graphics.lineTo(400200);
            shape.graphics.lineTo(0200);
            shape.graphics.lineTo(00);
            shape.graphics.endFill();
            addChild(shape);
        }
    }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Graphics
» Gradient