2 Replies Latest reply on Jul 14, 2011 2:47 AM by Ibarim

    Drawing ellpise with gradient fill

    Ibarim Level 1

      Hi,

       

      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.