I got a problem with drawing ellipse filled with gradient. My code looks like this:
var circle:Sprite; circle = new Sprite(); circle.graphics.beginGradientFill(GradientType.LINEAR,[0xFF0000,0x0000FF],[1,.4],[200,255]); circle.graphics.drawCircle(100,300,50); // THIS WORKS - MAKES A CIRCLE WITH GRADIENT FILL circle.graphics.drawEllipse(100,300,100,100); //THIS DOESN'T WORK - ELLIPSE HAS ONE COLOR FILL, NO GRADIENT circle.graphics.endFill(); var regularObject:UIComponent = new UIComponent(); regularObject.addChild(circle); Application.application.addChild(regularObject);
I'd appreciate any help. Thanks in advance.
it does work. move your ellipse to 0, 0
I am not very good with the understand of gradient fills but its like the gradient fill is acting as a mask spread across the stage and where you were drawing the ellipse was a solid uniform colour
You're right. Thanks a lot.
Although it's strange behaviour