Applying Gradient Fills : Gradient : Graphics Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Graphics » Gradient »

 

Applying Gradient Fills


 
package{
  import flash.display.*;
  import flash.geom.*;
  public class Main extends Sprite{
    public function Main(){

        var shape: Shape = new Shape ();
        shape.x = 100;
        shape.y = 100;
        
        var mxBox:Matrix = new Matrix();
        mxBox.createGradientBox(200200);
        
        shape.graphics.lineStyle(10);
        
        shape.graphics.beginGradientFill("radial"[0xFFFF000x00FFFF],  
        [100100][0x000xFF], mxBox, "reflect""RGB"1);
        shape.graphics.curveTo(200, -1004000);
        shape.graphics.lineTo(400200);
        shape.graphics.lineTo(0200);
        shape.graphics.lineTo(00);
        shape.graphics.endFill();
    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Graphics
» Gradient