flex radiobutton checkbutton combox color flex 教程 flex培训 flex源码 flex实例
来源:互联网 发布:淘宝分享有赏红包规则 编辑:程序博客网 时间:2024/06/06 01:19
flex 单选框,复选框 下拉框,及颜色选择框。
现在的版本已经升级到flex4 了,我在网上找的部分代码还是flex 3 的,因为代码升级的原因,大部分的flex3代码是可以运行的,还有一部分内容不能运行了,还要做一些改动或升级。最主要的区别是flex 3 默认主题是halo,而flex4 已经升级为spark,相应的标记也由mx升级为s.详细的区别还要再查找资料。
本系列的源码主要来自于网上,同时,还有来自于《自学flex》一书中。
<?xml version="1.0" encoding="utf-8"?>
<!--转:http://blog.sina.com.cn/s/blog_6dd3fe2e0100pa6v.html-->
<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">
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>
<!--flex3 中的script 要用mx flex4中要用到fx-->
<fx:Script>
<![CDATA[
protected function button1_clickHandler(event:MouseEvent):void
{
// TODO Auto-generated method stub
var s :String;
s="";
if(cbVideoGames.selected)
{
s = s + cbVideoGames.label;
}
if(cbFishing.selected)
{
s = s + cbFishing.label;
}
mx.controls.Alert.show(s);
}
public function showMsg(msg:String):void
{
mx.controls.Alert.show(msg);
}
]]>
</fx:Script>
<mx:Panel width="400" height="150" title="Profile">
<!-- *** CHECKBOX EXAMPLE *** -->
<mx:HBox>
<mx:Label text="Your hobbies:"/>
<mx:CheckBox id="cbVideoGames" label="Video Games"
click="showMsg('Video Games is ' + cbVideoGames.selected)"/>
<mx:CheckBox id="cbFishing" label="Fishing"
click="showMsg('Fishing is ' + cbFishing.selected)"/>
</mx:HBox>
<!-- *** RADIO BUTTON EXAMPLE *** -->
<mx:HBox>
<mx:Label text="Do you like spam:"/>
<!-- This is going to cause two popups occur. -->
<!-- The click event on the radiobutton will fire -->
<!-- And then the itemClick on the radio button group will fire -->
<!-- The RadioButtonGroup is optional. -->
<!-- Use it when you need to call a single function regardless -->
<!-- of radio button -->
<mx:RadioButtonGroup id="Spam"
itemClick="showMsg('User picked ' + event.currentTarget.selectedValue)"/>
<mx:RadioButton id="rbYes" value="Yes" groupName="Spam"
click="showMsg('Yes')" label="Yes"/>
<mx:RadioButton id="rbNo" value="No" groupName="Spam"
click="showMsg('No')" label="No"/>
</mx:HBox>
<!-- *** COMBOBOX AND COLORPICKER EXAMPLE *** -->
<mx:HBox>
<mx:Label text="Favorite car maker:"/>
<mx:ComboBox id="combo"
change="showMsg('Favorite car is ' + event.currentTarget.selectedItem)">
<!--flex3 中的array 要用mx flex4中要用到fx-->
<fx:Array>
<fx:String>Ferrari</fx:String>
<fx:String>Porsche</fx:String>
<fx:String>Hyundai</fx:String>
</fx:Array>
</mx:ComboBox>
<mx:Label text="With the color of:"/>
<mx:ColorPicker id="clr"
change="showMsg('Color ' + event.currentTarget.selectedColor)"/>
</mx:HBox>
<s:Button label="按钮" click="button1_clickHandler(event)"/>
</mx:Panel>
</s:Application>
- flex radiobutton checkbutton combox color flex 教程 flex培训 flex源码 flex实例
- flex App小例子Combox List flex 教程 flex培训 flex源码 flex实例
- flex AdvancedDataGrid flex 教程 flex培训 flex源码 flex实例
- flex CurrencyValidator flex 教程 flex培训 flex源码 flex实例
- flex Accordion 导航器容器 flex 教程 flex培训 flex源码 flex实例
- flex Accordion 导航器容器2 flex 教程 flex培训 flex源码 flex实例
- flex Accordion 导航器容器3 flex 教程 flex培训 flex源码 flex实例
- flex datagrid 复杂表格 树型表格 flex 教程 flex培训 flex源码 flex实例
- flex datagrid 添加树 flex 教程 flex培训 flex源码 flex实例
- flex datagrid 添加树2 flex 教程 flex培训 flex源码 flex实例
- flex AdvancedDataGrid 多表头 flex 教程 flex培训 flex源码 flex实例
- flex 自定义类as 调用类 静态方法 flex 教程 flex培训 flex源码 flex实例
- flex 类似于flash的过渡效果 flex 教程 flex培训 flex源码 flex实例
- flex NumericStepper HSlider flex 教程 flex培训 flex源码 flex实例
- flex 自定义css样式来改变button的颜色 flex 教程 flex培训 flex源码 flex实例
- FLEX
- flex
- flex
- 删除程序自身
- JAVA 关闭窗口的设置 DISPOSE_ON_CLOSE和EXIT_ON_CLOSE 的区别
- Windows Service
- java 基础总结(个人网络存储)
- [C#]用户名&&密码
- flex radiobutton checkbutton combox color flex 教程 flex培训 flex源码 flex实例
- 鼠标点击出现下拉菜单,点其他地方,缩回去。
- STL String
- C/C++刁钻问题各个击破之序言
- flex拓扑图制作
- C/C++刁钻问题各个击破之细说sizeof
- 怎样调试xml文件不提示
- POJ1279/ZOJ1369 Art Gallery,POJ2451 Uyuw's Concert(半平面交求多边形的核)
- poj 2773 Happy 2006