MACROMEDIA FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 Manuel d'utilisateur Page 123

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 184
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 122
Using styles 123
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 getStyleDeclaration() method.
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
fontSize
and
fontStyle properties.
<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 applications display list.
Vue de la page 122
1 2 ... 118 119 120 121 122 123 124 125 126 127 128 ... 183 184

Commentaires sur ces manuels

Pas de commentaire