Flex中如何通过disabledIcon样式和enabled属性在Button在改变有效/无效状态时改变图标的例子
2010-04-13 17:53
891 查看
接下来的例子演示了Flex中如何通过disabledIcon样式和enabled属性,在Button在改变有效/无效状态时改变图标。
让我们先来看一下Demo(可以右键View Source或点击这里察看源代码
):
下面是完整代码(或点击这里察看): Download: main.mxml<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"> <mx:Style> .addButton { icon: Embed(source="images/bullet_add.png"); disabledIcon: Embed(source="images/bullet_delete.png"); } </mx:Style> <mx:ApplicationControlBar dock="true"> <mx:CheckBox id="checkBox" label="enabled:" labelPlacement="left" selected="true" /> </mx:ApplicationControlBar> <mx:Button label="Add" enabled="{checkBox.selected}" styleName="addButton" /> </mx:Application> 本文转自:http://blog.minidx.com/2008/11/06/1608.html
相关文章推荐
- Flex中如何通过enabled属性在RadioButtonGroup中将所有的RadioButton设置为有效或无效状态的例子
- Flex中如何通过showCloseButton属性控制TitleWindow右上角关闭按钮有效/无效的例子
- Flex中通过disabledIconColor样式设置NumericStepper控件图标(icon)无效时的颜色的例子
- Flex中如何通过sortArrowSkin样式改变DataGrid排序图标的例子
- Flex中如何通过showCloseButton属性,控制TitleWindow右上角关闭按钮有效/无效
- Flex中如何通过icon样式从SWF中指定一个Button的例子
- Flex中如何通过设置editable属性控制NumericStepper控件可编辑/不可编辑状态的例子
- Flex中如何通过disabledColor样式设置NumericStepper控件无效时文本颜色的例子
- Flex中如何通过getHeaderAt()函数以及selectedUpIcon,selectedOverIcon和selectedDownIcon样式给Accordion头部设置一个分割用图标的例子
- Flex中如何利用folderOpenIcon, folderClosedIcon和defaultLeafIcon样式改变默认文件夹和子项目图标的例子
- Flex中如何通过mode属性设置进度条ProgressBar动画状态的例子
- Flex中如何通过iconField样式给LinkBar添加Icon图标的例子
- 改变Flex中TileList控件拖动状态(有效/无效)的例子
- Flex中如何通过selectionColor和selectionDisabledColor样式设置DataGrid的行选中与无效时颜色的例子
- Flex中如何通过getHeaderAt()函数以及selectedUpIcon,selectedOverIcon和selectedDownIcon样式给Accordion头部设置一个分割用图标的例子
- Flex中如何通过lineStroke样式改变LineChart图表线条颜色的例子
- Flex中如何通过mode属性,设置进度条ProgressBar动画状态
- Flex中如何通过给openItems属性设置一个XMLList或Array对象来打开Tree的一个节点的例子
- Flex中如何通过direction属性,改变Box容器(HBox或VBox)方向
- Flex中如何利用closeButtonSkin或closeButtonUpSkin, closeButtonOverSkin, closeButtonDownSkin, closeButtonDisabledSkin样式,改变TitleWindow容器的