Applying CSS styles to Flex components
105
Creating new CSS styles
You can visually create new CSS styles for Flex components. You can define them in an external
CSS file or in the MXML file containing the components you want to format.
To create new styles:
1.
In the CSS Styles panel (Window > CSS Styles), click the New CSS Style button (+) located in
the lower right area of the panel.
The New CSS Style dialog box appears.
2.
Select a selector type.
Flex supports class selectors and tag selectors. A class selector defines a new named style, such
as myclass, that you can apply to any component.
A tag selector applies to all components of a particular type. For example, if you select the
TextInput component and set the background color to blue, a blue background is
automatically applied to all TextInput objects.
3.
Select the location where you want to define the new style as follows:
■
To define the style in a new external style sheet, select New Style Sheet File.
■
To define the style in an existing style sheet attached to the current file, select the CSS file
from the Define In pop-up menu.
■
To embed the style in the current file, select This Document Only.
4.
Click OK.
The New CSS Style dialog box closes and the Style Definition dialog box opens.
5.
Use the dialog box options to define the new CSS style.
6.
When you’re finished, click OK.
7.
If you created the style in an external style sheet, make sure to upload the style sheet to the server
to ensure your changes are reflected when you compile and run the file.
Related topics
•
“Creating a new CSS style” in Using Dreamweaver Help
•
“About CSS styles in Flex” on page 103
•
“Importing styles from an external CSS file” on page 104
Summary of Contents for FLEX BUILDER-USING FLEX BUILDER
Page 1: ...Using Flex Builder...
Page 116: ...116 Chapter 4 Building a Flex User Interface Visually...
Page 144: ...144 Chapter 6 Working with Data...
Page 154: ...154 Appendix A Basic Flex Concepts...