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

Home
Flash / Flex / ActionScript
1.Animation
2.Array
3.Class
4.Data Type
5.Development
6.Function
7.Graphics
8.Language
9.Network
10.Regular Expressions
11.Statement
12.String
13.TextField
14.XML
Flash / Flex / ActionScript » 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);
        }
    }
}

        














Related examples in the same category
1.Line Gradient Test
2.Create Gradient box
3.Create a Ball by using the Gradient
4.Applying Gradients to Lines
5.lineGradientStyle("linear", [0xFFFF00, 0x00FFFF], [100, 100], [0x00, 0xFF], mxBox, "reflect", "linearRGB")
6.lineGradientStyle("radial", [0xFFFF00, 0x00FFFF], [100, 100], [0x00, 0xFF], mxBox, "pad", "linearRGB")
7.lineGradientStyle("radial", [0xFFFF00, 0x00FFFF], [100, 100], [0x00, 0xFF], mxBox, "pad", "linearRGB", 1)
8.Applying Gradient Fills
9.A shape with evenly rounded corners
10.Rotating Objects with Filters
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.