FLEX CSS定义控件样式
2010年07月21日
最容易看到效果的
Button控件
1.在项目根目录下的.actionScriptProperties文件中加入
//编译该CSS文件到SWF文件
2.在FLEX里面创建src/MAINUI.css文件
3.在写好的FLEX里定义个一Button的styleName属性的值
例如:
4.开始写CSS代码
Button.loginButton
{
downSkin:Embed(source="images/images1.png",scaleGridLeft="8",scaleGridRight="8",scaleGridBottom="8",Top="8",)
overSkin:Embed(source="images/images2.png",scaleGridLeft="8",scaleGridRight="8",scaleGridBottom="8",Top="8",)
upSkin:Embed(source="images/images3.png",scaleGridLeft="8",scaleGridRight="8",scaleGridBottom="8",Top="8",)
disableSkin:Embed(source="images/images4.png",scaleGridLeft="8",scaleGridRight="8",scaleGridBottom="8",Top="8",)
color:#cccccc;
fontSize:12;
fontWeight:bold;
textRollOverColor:#dddddd;
textSelectColor:#111111;
paddingTop:0;
paddingLeft:0;
paddingRight:0;
paddingBottom:0;
}
代码结构基本和网页代码中的CSS一样,具体到细节部分需要调整。
其他的控件样式代码例如
DataGrid列表数据
Canvas容器
CheckBox勾选按钮
RadioButton单选按钮
Alert
Panel框体
Label标签
TextInput输入框
Menu菜单选项卡
TextArea文字显示框
ToolTip文字提示
NumericStepper数字选择下拉框
ComboBox选择下拉框
2010年07月21日
最容易看到效果的
Button控件
1.在项目根目录下的.actionScriptProperties文件中加入
//编译该CSS文件到SWF文件
2.在FLEX里面创建src/MAINUI.css文件
3.在写好的FLEX里定义个一Button的styleName属性的值
例如:
4.开始写CSS代码
Button.loginButton
{
downSkin:Embed(source="images/images1.png",scaleGridLeft="8",scaleGridRight="8",scaleGridBottom="8",Top="8",)
overSkin:Embed(source="images/images2.png",scaleGridLeft="8",scaleGridRight="8",scaleGridBottom="8",Top="8",)
upSkin:Embed(source="images/images3.png",scaleGridLeft="8",scaleGridRight="8",scaleGridBottom="8",Top="8",)
disableSkin:Embed(source="images/images4.png",scaleGridLeft="8",scaleGridRight="8",scaleGridBottom="8",Top="8",)
color:#cccccc;
fontSize:12;
fontWeight:bold;
textRollOverColor:#dddddd;
textSelectColor:#111111;
paddingTop:0;
paddingLeft:0;
paddingRight:0;
paddingBottom:0;
}
代码结构基本和网页代码中的CSS一样,具体到细节部分需要调整。
其他的控件样式代码例如
DataGrid列表数据
Canvas容器
CheckBox勾选按钮
RadioButton单选按钮
Alert
Panel框体
Label标签
TextInput输入框
Menu菜单选项卡
TextArea文字显示框
ToolTip文字提示
NumericStepper数字选择下拉框
ComboBox选择下拉框
本文详细介绍了如何使用FlexCSS定义Button控件样式,并提供了其他控件样式的定义方法,包括DataGrid、Canvas、CheckBox等。教程通过实际代码演示了如何在ActionScriptProperties文件中配置CSS文件,以及如何在FLEX中应用自定义样式。
816

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



