Hi chellem,
    Here is the code of a custom component that i have cheated
you can pass the gradient color values to the fillcolors. to get the
desired effect.

package
{
        import mx.containers.Canvas;
        import mx.styles.StyleManager;

    public class GradientCanvas extends Canvas
    {
        /**
         * @private  //to hold the gradient color
         * */
        private var _fillColors:Array = new Array;
        public function set fillColors(value:Array):void
        {
                this._fillColors = value;
        }

        /**
         * @private  //to hold the gradient alphas
         * */
        private var _fillAlphas:Array = new Array;
        public function set fillAlphas(value:Array):void
        {
                this._fillAlphas = value;
        }

        /**
         * @private  // hold the corner radius
         * */
        private var _cornerRadius:Number = 0;
        public function set cornerRadius(value:Number):void
        {
                this._cornerRadius = value;
        }

        override protected function updateDisplayList(w:Number,
h:Number):void
        {
            super.updateDisplayList (w, h);

            // retrieves the user-defined styles
            var fillColors:Array = _fillColors;
            var fillAlphas:Array = _fillAlphas;
            var cornerRadius:Number = _cornerRadius;

            // converts the fill colors to RGB color values
            StyleManager.getColorNames (fillColors);

            // ready to draw!
             graphics.clear ();

            // draws the gradient
            drawRoundRect (0, 0, w, h, cornerRadius,
fillColors,fillAlphas, verticalGradientMatrix (0, 0, w, h));
        }
    }
}


On Jul 2, 1:05 pm, chellem <tamilarasan2...@gmail.com> wrote:
> Dear sir
>
> I need flex canvas gradient background samples.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to flex_india@googlegroups.com
To unsubscribe from this group, send email to 
flex_india+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to