ActionScript 2.0 Components Language Reference |
|
|
|
| Window component > Window.titleStyleDeclaration | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
windowInstance.titleStyleDeclaration
Property; a string indicating the style declaration that formats the title bar of a window. The default value is undefined, which indicates bold, white text.
The following example creates a CSS style declaration to make text 14 points in size, italicized and underlined. It uses the titleStyleDeclaration property to apply that style to the title of the pop-up window that it creates. You drag a Window component from the Components panel to the current document's library, and then add the following code to Frame 1.
/**
Requires:
- Window component in library
*/
import mx.styles.CSSStyleDeclaration
import mx.managers.PopUpManager
import mx.containers.Window
// Create a new CSSStyleDeclaration named TitleStyles
// and list it with the global styles list.
_global.styles.TitleStyles = new CSSStyleDeclaration();
// Customize styles.
_global.styles.TitleStyles.fontStyle = "italic";
_global.styles.TitleStyles.textDecoration = "underline";
_global.styles.TitleStyles.color = 0xff0000;
_global.styles.TitleStyles.fontSize = 14;
// Create window.
var my_win:MovieClip = PopUpManager.createPopUp(this, Window, true, {closeButton:true, titleStyleDeclaration:"TitleStyles"});
// Set window attributes.
my_win.title = "Testing Styles";
my_win.setSize(200, 100);
my_win.move(20, 20);
// Create listener object.
var winListener:Object = new Object();
winListener.click = function(evt_obj:Object) {
trace("closing window");
evt_obj.target.deletePopUp();
};
// Add listener.
my_win.addEventListener("click", winListener);
For more information about styles, see Using styles to customize component color and text in Using ActionScript 2.0 Components.
|
|
|
|