Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 184

Creating and extending flex 2 components
Hide thumbs Also See for FLEX 2 - CREATING AND EXTENDING COMPONENTS:
Table of Contents

Advertisement

About inheritance in Cascading Style Sheets
When you implement a style property in an ActionScript component, that property is
automatically inherited by any subclasses of your class, just as methods and properties are
inherited. This type of inheritance is called object-oriented inheritance.
Some style properties also support Cascading Style Sheet (CSS ) inheritance. CSS inheritance
means that if you set the value of a style property on a parent container, a child of that
container inherits the value of the property when your application runs. For example, if you
define the
style as Times for a
Panel
container, all children of that container use
fontFamily
Times for
, unless they override that property.
fontFamily
In general, color and text styles support CSS inheritance, regardless of whether they are set by
using CSS or style properties. All other styles do not support CSS inheritance, unless
otherwise noted.
If you set a style on a parent that does not support CSS inheritance, such as
,
textDecoration
only the parent container uses that value, and not its children. There is an exception to the
rules of CSS inheritance. If you use the global type selector in a CSS style definition, Flex
applies those style properties to all controls, regardless of whether the properties are
inheritable.
For more information about style inheritance, see Chapter 18, "Using Styles and Themes," in
Flex 2 Developer's Guide.
About setting styles
Flex provide several ways of setting component styles: using MXML tag attributes, calling the
method, and CSS. This section describes the different ways to set styles, and the
setStyle()
actions that Flex performs when you set styles.
184
Creating Custom Style Properties

Advertisement

Table of Contents
loading

Table of Contents