Search Flex Components Free

Custom Search

December 10, 2007

Gradient PanelBase with AS

As a follow-up to Dynamic Gradients in AS, here is the PanelBase. The PanelBase is a decoration control for creating an Panels, HBox, VBox, Dialogs, Windows, etc.

The version here supports:

1. Dynamically rounded corners via a property.
2. 12 Gradient types including none, vertical, angle, light, and dark.
3. PanelBase is resizeable via setSize methods.
3. Dynamically Color the gradients with RGB values.

The trick is using a mask with drawing API contents and a clip of 12 predefined gradients. Also you must hide the mask clip from V2 by blocking path lookups to the clips. V2 focusManager uses the drawing API to render glows on selected controls, when the glow is fired, clear() is called eliminating all drawing API content except the glow. You can avoid this by storing a reference to the mask in your class and having data that blocks access to the clip itself by name. FocusManager cannot reach in and overwrite your Drawing API layout.

Related Flex Tutorials