Macromedia flex 2-migrating applications to flex 2 Manual De Usuario
124
Styles and Skinning
Using units
Flex no longer supports using the plus (+) and minus (-) unit modifiers.
Flex no longer supports the em and ex unit types.
Using skinning
Previously, you defined graphical skins as symbols in a FLA file, exported the FLA file as a
SWC file from the Flash IDE, and added it to your Flex source path. The symbols in the new
SWC file replaced existing symbols in Flex component skins.
SWC file from the Flash IDE, and added it to your Flex source path. The symbols in the new
SWC file replaced existing symbols in Flex component skins.
Now, all skins are specified as style properties that can be set through CSS or inline. Do not
use the symbol substitution method of defining new skins.
use the symbol substitution method of defining new skins.
To use a programmatic skin, add the class to your ActionScript source path when you
compile. Then use the
compile. Then use the
ClassReference()
statement to reference that class in your
application’s CSS. For example, if you have MySkins/MyButtonSkin.as, you use the following
syntax to reference the class:
syntax to reference the class:
Button {
upSkin: ClassReference("MySkins.MyButtonSkin");
}
You use the
Embed()
statement to reference graphic skins in CSS.
Many style properties that referred to skins are now deprecated. For example, the
brokenImage
property is obsolete and was replaced by the
brokenImageSkin
style property.
This style property is of type Class. Flex throws an error if you try to apply a style to a
property that no longer exists. For a list of available skin style properties, see the control’s
entry in the Adobe Flex 2 Language Reference.
property that no longer exists. For a list of available skin style properties, see the control’s
entry in the Adobe Flex 2 Language Reference.
The drawing methods such as
moveTo()
that you would use in programmatic skinning are
now accessed through the
graphics
property of the MovieClip object. To use them you must
import the flash.display.* package.