User Guide
Window component 881
Text styles can be set on the Window component itself, or they can be set on the
_global.styles.windowStyles class style declaration. This has the advantage of not causing
style settings to propagate to child components through style inheritance.
The following example demonstrates how to italicize the title of a Window component without
having this setting propagate to child components.
import mx.containers.Window;
_global.styles.windowStyles.setStyle("fontStyle", "italic");
createClassObject(Window, "window", 1, {title: "A Window"});
Notice that this example sets the property before instantiating the window through
createClassObject(). For the styles to take effect, they must be set before the window is
created.
Using skins with the Window component
The Window component uses skins for its title background and close button, and a RectBorder
instance for the border. The Window skins are found in the Flash UI Components 2/Themes/
MMDefault/Window Assets folder in each of the theme files. For more information about
skinning, see “About skinning components” on page 80. For more information about the
RectBorder class and using it to customize borders, see “RectBorder class” on page 647.
The title background skin is always displayed. The height of the background is determined by the
skin graphics. The width of the skin is set by the Window component according to the Window
instance’s size. The close skins are displayed when the
closeButton property is set to true and
when a change state results from user interaction.
A Window component uses the following skin properties:
fontWeight
Both The font weight: either "none" or "bold". The default value
is
"none". All components can also accept the value "normal"
in place of "none" during a setStyle() call, but subsequent
calls to
getStyle() will return "none".
textAlign
Both The text alignment: either "left", "right", or "center". The
default value is
"left".
textDecoration
Both The text decoration: either "none" or "underline". The default
value is
"none".
textIndent
Both A number indicating the text indent. The default value is 0.
Property Description
skinTitleBackground
The title bar. The default value is TitleBackground.
skinCloseUp
The close button. The default value is CloseButtonUp.
skinCloseDown
The close button it its down state. The default value is
CloseButtonDown.
Style Theme Description