2 Replies Latest reply on Feb 18, 2010 7:47 AM by nikos101

    Photoshop grad editor for spark <s:LinearGradient

    nikos101 Level 2

      Is there a way to test this stuff online without having to compile it? Sort of like the photoshop grad editor

       

          <s:fill>
                  <s:LinearGradient rotation="45" >
                      <s:GradientEntry color="0x0e47a5" />
                      <s:GradientEntry color="0x3570d3" ratio=".6"/>
                      <s:GradientEntry color="0x0e47a5" />
                  </s:LinearGradient>
              </s:fill>

        • 1. Re: Photoshop grad editor for spark <s:LinearGradient
          David_F57 Level 5

          Hi,

           

          I usually drop a skinnable container onto designview then do a "create skin" and and then you see the fill.

           

          <?xml version="1.0" encoding="utf-8"?>

          <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"

              xmlns:fb="http://ns.adobe.com/flashbuilder/2009" alpha.disabled="0.5">

           

              <fx:Metadata>

              <![CDATA[

                  [HostComponent("spark.components.SkinnableContainer")]

              ]]>

              </fx:Metadata>

           

              <fx:Script fb:purpose="styling">

                  <![CDATA[        

                      override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number) : void

                      {

                          if (isNaN(getStyle("backgroundColor")))

                          {

                              background.visible = false;

                          }

                          else

                          {

                              background.visible = true;

                              bgFill.color = getStyle("backgroundColor");

                              bgFill.alpha = getStyle("backgroundAlpha");

                          }

           

                          super.updateDisplayList(unscaledWidth, unscaledHeight);

                      }

                  ]]>       

              </fx:Script>

           

              <s:states>

                  <s:State name="normal" />

                  <s:State name="disabled" />

              </s:states>

              <s:Rect id="background" left="0" right="0" top="0" bottom="0">

          <s:fill>

          <s:LinearGradient rotation="45" >

          <s:GradientEntry color="0x0e47a5" />

          <s:GradientEntry color="0x3570d3" ratio=".6"/>

          <s:GradientEntry color="0x0e47a5" />

          </s:LinearGradient>

          </s:fill>

           

              </s:Rect>

              <s:Group id="contentGroup" left="0" right="0" top="0" bottom="0" minWidth="0" minHeight="0">

                  <s:layout>

                      <s:BasicLayout/>

                  </s:layout>

              </s:Group>

          </s:Skin>