欢迎光临
我们一直在努力

Flash MX 2004 体验之旅 7-网页设计,Flash

建站超值云服务器,限时71元/月
预览效果.下面是这三个组件的前后效果对比图:
Flash MX 2004 体验之旅 7-网页设计,Flash
                        
这种方法使得场景里的所有组件的外观保持一致.

create custom style declarations and apply them to specific component instances.
(创建自定义样式声明并应用到指定的组件实例)

当我们把组件拖到场景里便可以利用cssstyledeclaration 对象创建一个样式声明来改变指定组件的外观。
还是从components面板拖button,checkbox和radiobutton三个组件到场景并分别命名为

compa, compb, compc. 在时间线上写action:


//创建一个cssstyledeclaration对象实例
var styleobj = new mx.styles.cssstyledeclaration;
//设置stylename属性
styleobj.stylename = "newstyle";
//将样式放到全局样式列表
_global.styles.newstyle = styleobj;
//设置样式属性
styleobj.fontfamily = "verdana";
styleobj.fontsize = "10";
styleobj.fontweight = "bold";
styleobj.color = "0x990000";
styleobj.setstyle("themecolor", "0x00ccff");
//对组件设置样式
compa.setstyle("stylename", "newstyle");
compb.setstyle("stylename", "newstyle");
compc.setstyle("stylename", "newstyle");


赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » Flash MX 2004 体验之旅 7-网页设计,Flash
分享到: 更多 (0)