flex中自定义按钮外观

| |
[夜晚 2006/04/04 00:48 | by xeric ]
flex中的button组件可以自定义外观,
但是似乎mxml方法更加便捷一些,
不过,如果希望做成一个额外的组件,
那么完全可以在as里面来完成,
只要添加如下一些定义:

//首先在类里面定义css:
[Embed("maximize.gif")]
var os:Class;

//然后就可以通过setStyle的方法来放皮肤了,想要什么,那就多定义一些css吧:)
private function addCloseIcon():void{
  var button:Button = new Button();
  button.graphics.clear();
  button.setStyle("upSkin", os);
  button.setStyle("downSkin", os);
  button.setStyle("overSkin", os);
  this.addChild(button);
}


看来还是相当简单的。
闪[FLASH] | 评论(0) | 引用(0) | 阅读(3480)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 请输入左侧的字母,不区分大小写