Adobe FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 Manual page 123

Migrating applications to flex 2
Table of Contents

Advertisement

For example:
<mx:Style>
// The following class selector fails in Flex 2 if
// there is no associated class:
myClass {
color: red;
}
// The following class selector works fine in Flex 2:
.myOtherClass {
color: red;
}
</mx:Style>
You must include the period when you use the
Global style sheet
The global style sheet, global.css, was removed. Flex now uses a default style sheet,
defaults.css, which is in the frameworks.swc file.
If you are migrating an existing 1.5 application that depended on the global.css file, you can
still use global.css, but you must compile it into a theme (importing global.css is no longer
automatic). For more information on compiling themes, see Chapter 18, "Using Styles and
Themes," in the Flex 2 Developer's Guide.
Using type selectors
Properties set in type selectors now obey object-oriented inheritence rules. If you define a type
selector for a class, Flex applies all properties in that type selector to that class, as well as
subclasses of that class. For example, VBox is a subclass of Box, which is a subclass of
Container.
If you define the following type selectors, VBox controls inherit the values of the
and
properties.
fontStyle
<mx:Style>
Container { fontSize:14 }
Box { fontStyle: bold }
VBox { color:red }
</mx:Style>
Previously, properties set in type selectors that were parents of a class did not apply to that
class, unless that class was a child object in the application's display list.
getStyleDeclaration()
method.
fontSize
Using styles
123

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex 2

Table of Contents