下面是Flex4的代码,非常的简单,一看就明白..不解释.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<s:layout>
<s:BasicLayout/>
</s:layout>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>
<s:Label
x="176"
y="169"
text="爱好:" width="38"/>
<s:CheckBox
x="217" y="165"
id="chkBaseID"
label="{chkBaseID.selected==true?'取消全选':'全部选择'}"/>
<s:CheckBox
x="314"
y="165"
label="打游戏" width="56" id="chkGame" selected="{chkBaseID.selected}"/>
<s:CheckBox
x="394"
y="165"
label="听音乐" width="56" id="chkMinus" selected="{chkBaseID.selected}"/>
<s:CheckBox
x="479"
y="165"
label="看小说" width="56" id="chkxs" selected="{chkBaseID.selected}"/>
<s:CheckBox
x="563"
y="165"
label="看电影" width="56" id="chkdy" selected="{chkBaseID.selected}"/>
</s:Application>
运行结果: