myTitleWindow.css文件

/**//* CSS file */
Application{...}{
fontSize: 12;
backgroundGradientColors: #006699, #AEB4E6;
/**//* backgroundImage: Embed(source="skin/background.swf"); 把swf文件嵌入到程序中*/
backgroundImage: Embed(source="skin/pet.swf");
}
TitleWindow{...}{
borderStyle: "default";
borderSkin: Embed(source="skin/windows_skin.swf", symbol="window_border");
/**//* symbol指SWF文件中元件在库中的链接名 */
closeButtonDisabledSkin: Embed(source="skin/windows_skin.swf",symbol="close_disable");
closeButtonDownSkin: Embed(source="skin/windows_skin.swf",symbol="close_down");
closeButtonOverSkin: Embed(source="skin/windows_skin.swf",symbol="close_over");
closeButtonUpSkin: Embed(source="skin/windows_skin.swf",symbol="close_up");
cornerRadius: 4;
dropShadowEnabled: true;
paddingBottom: 0;
paddingLeft: 0;
paddingRight: 0;
paddingTop: 0;
titleStyleName: "winTitle";
}
.winTitle
{...}{
fontWeight: "bold";
}
myTitleWindow.mxml文件
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Style source="myTitleWindow.css"></mx:Style>
<!-- TitleWindow是Panel的子类,只比Panel组件多了一个关闭按钮,因此它有Panel的全部样式属性。 -->
<mx:TitleWindow x="10" y="10" width="250" height="200" layout="absolute" showCloseButton="true" title="TitleWindow">
<mx:TextArea x="10" y="10" height="106" width="220" text="输入文本"/>
</mx:TitleWindow>
<mx:Panel x="340" y="10" width="250" height="200" layout="absolute">
<mx:Button x="39" y="23" label="Button"/>
<mx:CheckBox x="70" y="93" label="Checkbox"/>
</mx:Panel>
</mx:Application>
本文介绍如何使用Flex中的TitleWindow组件并定制其外观和行为,包括背景图像、按钮皮肤等样式设置。

被折叠的 条评论
为什么被折叠?



