Thursday, June 26th, 2008

Enabling A Drop Shadow On A Flex Container

By Javier Julio

To set a drop shadow on say a VBox or HBox component you simply set the boolean property dropShadowEnabled to “true” — but this is not enough to make the drop shadow appear. An example:

  1. 

To have the drop shadow appear (with its default shadow color) you need to specify a value for borderStyle since the default is none. Setting the borderStyle property doesn’t necessarily mean you have to display a border, but it is needed for the drop shadow to appear. So if the border is not desired, simply set the style property borderThickness to 0. An example:

   1. 

The above sample will display a drop shadow for the HBox component without a visible border.

Leave a Comment