Posted By

kajyr on 02/02/10


Tagged

Fill gradient actionscript3


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

adrianparr
dubogii


Actionscript gradient


 / Published in: ActionScript 3
 

URL: http://www.nightdrops.com

  1. var gradientWidth:int = 100;
  2. var gradientHeight:int = 300;
  3. var angle:Number = 0;
  4.  
  5. var matrix:Matrix = new Matrix();
  6. matrix.createGradientBox(gradientWidth, gradientWidth, (Math.PI / 180) * angle, 0, 0);
  7.  
  8. graphics.beginGradientFill(GradientType.LINEAR, [0xefefee, 0xa4a5a7], [1, 1], [0, 255], matrix);
  9. graphics.drawRect(0, 0, gradientWidth, gradientWidth);
  10. graphics.endFill();

Report this snippet  

You need to login to post a comment.