Set line gradient style with Matrix : Gradient : Graphics Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Graphics » Gradient »

 

Set line gradient style with Matrix


 
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("linear"[0xFFFF000x00FFFF],  
            [100100][0x000xFF], mxBox, "reflect");
            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