1 Reply Latest reply on Nov 14, 2006 4:45 PM by chris.huston.t10

    buttons and drop shadow

    wicklow
      hi there,

      i am new to flex, usually design in PhotoShop or Illustrator- have been asked to design a layout in Flex. I understand some code, but mostly using the properties windows to apply styles. I am just trying to figure out when i drop a button onto the main view, where i can apply a drop shadow from, and set it's properties?

      thanks!
      shannon
        • 1. Re: buttons and drop shadow
          chris.huston.t10 Level 3
          You first need to define a drop shadow filter that you can assign to your button. You can do something like this:

          <mx:Script>
          <![CDATA[
          import flash.filters.DropShadowFilter;
          [Bindable]
          private var ds:DropShadowFilter = new DropShadowFilter(4,45,0x000000,1.0,4.0,4.0,1.0,1.0);
          ]>
          </mx:Script>

          Then, assign the filter to your button like this:
          <mx:Button label="Button" filters="{[ds]}" fillAlphas="[1.0, 1.0]"/>

          Setting the fillAlphas to 1.0 will prevent the drop shadow from showing through your button.

          You can use the same setting for all your buttons if you need to. You can also change the drop shadow properties to suit your needs.

          DropShadowFilter(distance,angle,color,alpha,blurX,blurY,strength,quality,inner, knockout);

          Vygo