WSDoubleBorderSkin is a programmatic skin extending mx.skins.Border for adding double borders on Flex containers such as Canvas, HBox, VBox, Form etc. It supports properties for different border positions such as borderTop or borderBottom, colors and thicknesses using CSS. It’s designed for using Flex states based on mx.states.Transition. The WSDoubleBorderSkin is tested under Flex 2 and 3 (Moxie).

Screen shot

Instructions

Code snippets for using WSDoubleBorderSkin

  1. //
  2. //  [1] Define style properties:
  3. <mx:Style>
  4.     .wsDoubleBorder
  5.     {
  6.         borderSkin: ClassReference("skins.WSDoubleBorderSkin");
  7.         borderTopThickness: 3;
  8.         borderTopColor: #3ad2ed;
  9.         borderRightThickness: 3;
  10.         borderRightColor: #3399CC;
  11.         borderBottomThickness: 3;
  12.         borderBottomColor: #FF6600;
  13.         borderLeftThickness: 3;
  14.         borderLeftColor: #99CC00;         
  15.         backgroundColor: #FFFFFF;
  16.         backgroundAlpha: 90;
  17.         /*  Optionally: using one border only
  18.         doubleBorder: false;
  19.         */
  20.     }
  21. </mx:Style>
  22. //
  23. //  [2] Point these styles to a container, e.g. Canvas:
  24. <mx:Canvas id="standardCanvas"
  25.     styleName="wsDoubleBorder" />   
  26. //
  27. //  [2 b] Optionally: Using common properties "borderThickness"
  28. //  and "borderColor" for using one color or one thickness
  29. //  without any style definitions within <mx:Style>:
  30. <mx:Canvas id="standardCanvas"
  31.     width="300" height="200"
  32.     borderSkin="skins.WSDoubleBorderSkin"
  33.     borderThickness="3" borderColor="#99CC00" backgroundColor:"#FFFFFF" />
  34. // 
  35. //  That’s all ;)
  36.  
  37.  

Example (incl. source code)

Here you’ll find an example including the source code. WSDoubleBorderSkin is open source licensed under the Mozilla Public License 1.1.

Have fun! ;-)

Related Articles

4 Responses to “Skinning Flex containers using WSDoubleBorderSkin”

  1. MadeInFlex » Blog Archive » Fondos para componentes con ActionScript3 y CSS Says:

    [...] Componente para skin de borders –> WSDoubleBorderSkin http://www.websector.de/blog/2007/07/04/skinning-flex-containers-using-wsdoubleborderskin [...]

  2. blog.2grafic.com » Blog Archive » Skins para componentes con AS3 y CSS Says:

    [...] Componente para skin de borders –> WSDoubleBorderSkin – Componente para backgrounds de componentes –> WSBackgroundPixelSkin – Componente para [...]

  3. Jeremie Says:

    Thank you very much. Help a lot!!!

  4. improvise adapt overcome » Blog Archive » Crawling in my skin: Flex Skinning Links Says:

    [...] http://www.websector.de/blog/2007/07/04/skinning-flex-containers-using-wsdoubleborderskin/ [...]

Leave a Reply

Follow sectore on Twitter