ActionScript Drawing Gradient Line With Transparency

Posted by TheDarkIn1978 on Stack Overflow See other posts from Stack Overflow or by TheDarkIn1978
Published on 2010-05-22T19:27:53Z Indexed on 2010/05/22 19:30 UTC
Read the original article Hit count: 205

Filed under:
|
|

i'm attempting to draw a simple gradient line with some transparency, but the portion of the line that receives 0 for the alpha draws black.

var lineMatrix:Matrix = new Matrix();
lineMatrix.createGradientBox(500, 1);

var line:Sprite = new Sprite();
line.graphics.lineStyle(1, 0, 1, false, LineScaleMode.NONE, CapsStyle.NONE);
line.graphics.lineGradientStyle(GradientType.LINEAR, [0XFF0000, 0, 0xFF0000], [1, 0, 1], [0, 127, 255], lineMatrix);
line.graphics.moveTo(0, 0);
line.graphics.lineTo(500, 0);

addChild(line);

what am i doing wrong?

© Stack Overflow or respective owner

Related posts about actionscript-3

Related posts about line