Apply styles at Runtime


Problem

How to apply styles at runtime

Solution

Create an instance for CSSStyleDeclaration

Use StyleManager.setStyleDeclaration(“”) method to apply style Styles

Example

In this example i applied Styles for the following UI Components

Panel,ComboBox,Button,HBox,ApplicationControlBar

1.Open  new Flex Project

2.Copy the coding from my Box Widget and paste it inside the

source View of your Flex Builder

3.Save and Run the Application

How to Run

1. Click ApplicationControlBarStyle Button:- Apply Styles to

Application ControlBar

2. Click PanelStyle Button –Apply Styles to Panel Panel

3. Click ComboBoxStyle Button –Apply  Styles to ComboBox

4. Click ButtonStyle Button- Apply Styles to  all Buttons

5. Click ApplicationStyle Button –Apply Styles to  Application.


With Regards

Hemakumar.S

Leave a Comment