0 Replies Latest reply on Oct 3, 2008 2:27 AM by _apk

    trying to build a RadialGradient array to be used to draw pie chart's item

      I'm trying to write a function to draw radials on a pie chart's slice, but I'm having some issues with

      If I use a function like this (taken from a web site) everything works, and I'm able to get one radialgradient on one pie's slice.
      public var pieColors:Array = fillColorArray();
      private function fillColorArray2():Array {
      var gradients:Array = new Array();
      var fill:RadialGradient = new RadialGradient();
      var g1:GradientEntry = new GradientEntry(0xEF7651,0.2);
      var g2:GradientEntry = new GradientEntry(0x994C34,1);
      fill.entries = [g1,g2];

      What I'm trying to achive, is to have a function that called with an RGB color as a parameter, returns a RadialGradient.
      This function is called several times (one per slice) in another function, that simply fills the gradients array set as bindable and used with fills="{pieColors}" inside <mx:PieSeries>.
      The problem is that I don't get the radial gradient displayed...I only get the first color (e.g. blue) that I use to "start" building the gradient.

      Please help me to find out what is wrong with this code, and please tell me if what I'm trying to achive is possible in flex 3.
      Thank you very much, and have a nice day!

      Code snippet follows: