title: Flex 4 fill color and gradient according to user requirement
body: <p>I want to design <strong>fill property</strong>(*<em>Color and Gradient</em>*) for a selected object(<strong>Display Object ,UIComponent or Group</strong>).
  I've design a interface for  color but it's only works for fill color.
  how i can design fill color and fill gradient simultaneously so user can fill color or gradient according to his/her requirement.  </p>
  
  <p>A single Object code is:- `</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" 
             xmlns:s="library://ns.adobe.com/flex/spark" 
             implements="sharedData.IObjectProperty"
             xmlns:mx="library://ns.adobe.com/flex/mx" width="120" height="70"&gt;
  
  
  
  &lt;fx:Script&gt;
      &lt;![CDATA[
          import mx.events.FlexEvent;
          import mx.graphics.GradientEntry;
          import mx.graphics.LinearGradient;
          import mx.graphics.SolidColor;
  
  
          private var _color:uint = 0xFFFFFF;
          private var _alpha:uint=1;
  
          private var _strokeColor:uint = 0x000000;
          private var _strokeAlpha:uint = 1;
          private var _strokeWeight:uint =1;
  
  
          [Bindable]
          public function get strokeColor():uint
          {
              return _strokeColor;
  
          }
  
          public function set strokeColor(Color:uint):void
          {
              _strokeColor = Color;
  
          }
  
          [Bindable]
          public function get strokeAlpha():uint
          {
              return _strokeAlpha;
  
          }
          public  function set strokeAlpha(Size:uint):void
          {
              _strokeAlpha = Size;
          }
          [Bindable]
          public function get strokeWeight():uint
          {
  
              return _strokeWeight;
          }
          public function set strokeWeight(Weight:uint):void
          {
              _strokeWeight = Weight;
          }
  
          /*property for color and alpha*/
  
          [Bindable]
          public function get ObjColor():uint
          {
              return _color;
  
          }
          public function set ObjColor(ColorObj:uint):void
          {
              _color = ColorObj;
          }
  
          [Bindable]
          public function get ObjAlpha():uint
          {
              return _alpha;
  
          }
          public function set ObjAlpha(AlphaObj:uint):void
          {  
              _alpha = AlphaObj;
  
          }
  
  
  
      ]]&gt;
  &lt;/fx:Script&gt;
  
  
      &lt;!--s:Path width="100%" height="100%" data="M 10 0 L 120 0 L 110 10 L 0 10 L 10 0 M 110 10 L 110 70 L 0 70 L 0 10 M 120 0 L 120 60 L 110 70"&gt;
          &lt;s:stroke&gt;
              &lt;s:SolidColorStroke color="#000033" alpha="1" 
                                  weight="1" pixelHinting="true"/&gt;
          &lt;/s:stroke&gt;
          &lt;s:fill&gt;
              &lt;s:SolidColor color="#FFFFFF" alpha="0.5"/&gt;
          &lt;/s:fill&gt;
      &lt;/s:Path--&gt;
  
      &lt;s:Path  width="100%" height="100%" data="M 10 0 L 130 0 L 120 10 L 0 10 L 10 0 M 0 10 L 0 70 L 120 70 L 120 10 M 120 70 L 130 60 L 130 0 L 120 10" id="iface"&gt;
  
          &lt;s:stroke&gt;
              &lt;s:SolidColorStroke alpha="{strokeAlpha}" color="{strokeColor}" weight="{strokeWeight}"/&gt;
  
          &lt;/s:stroke&gt;
  
          &lt;s:fill&gt;
              &lt;s:SolidColor alpha="{ObjAlpha}" color="{ObjColor}"&gt;
  
              &lt;/s:SolidColor&gt;
  
          &lt;/s:fill&gt;
  
  
  
      &lt;/s:Path&gt;
  
      &lt;fx:Declarations&gt;
          &lt;!-- Place non-visual elements (e.g., services, value objects) here --&gt;
      &lt;/fx:Declarations&gt;
  &lt;/s:Group&gt;
  `
  </code></pre>