1、Text控件

外观:

代码:

<?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"> <fx:Script>
<![CDATA[
import mx.controls.Alert;
public function showMsg(msg:String):void
{
Alert.show(msg);
}
]]>
</fx:Script> <s:Panel title="TextSample" verticalCenter="0" horizontalCenter="0">
<s:layout>
<s:VerticalLayout/>
</s:layout> <s:Label text="TextInput" fontWeight="bold"/>
<s:TextInput id="TextInput"/> <s:Label text="TextArea" fontWeight="bold"/>
<s:TextArea id="TextArea" textAlign="center" width="100%" height="40"/> <s:Label text="RichTextEditor" fontWeight="bold" color="#ff0000"/>
<mx:RichTextEditor id="RichTextEditor" height="150" width="650"
borderSkin="mx.skins.spark.BorderSkin" borderColor="0x000fff"/> <s:Label text="RichEditableText" fontWeight="bold"/>
<s:RichEditableText textAlign="center" color="#127892" backgroundColor="0xfff000" width="100%">
<s:content>
Greetings <s:span fontWeight="bold" color="#ff0000">people</s:span> of<s:br/>
<s:span fontSize="20">EARTH!</s:span>
</s:content>
</s:RichEditableText> </s:Panel> </s:Application>

TextSample

2、Date控件

外观:

代码:

<?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">
<fx:Script>
<![CDATA[
import mx.controls.Alert;
public function showMsg(msg:String):void
{
Alert.show(msg);
}
]]>
</fx:Script>
<s:Panel title="DateSample" verticalCenter="0" horizontalCenter="0">
<s:layout>
<s:VerticalLayout/>
</s:layout>
<s:Label text="DateField" fontWeight="bold" backgroundColor="0xff0022"/>
<mx:DateField text="12/05/2008" id="thisDateField"
change="showMsg(thisDateField.selectedDate.toString())"/> <s:Label text="DateChooser" fontWeight="bold" backgroundColor="0xff0022"/>
<mx:DateChooser id="thisDateChooser"
maxYear="2010" minYear="2006"
selectedDate="{new Date(2008,10, 15)}"
change="showMsg(thisDateChooser.selectedDate.toString())"> </mx:DateChooser>
</s:Panel>
</s:Application>

DateSample

3、Numeric控件

外观:

代码:

<?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"> <fx:Script>
<![CDATA[
import mx.controls.Alert;
public function showMsg(msg:String):void
{
Alert.show(msg);
}
]]>
</fx:Script>
<s:Panel title="NumericSample" width="360" height="240" horizontalCenter="0" verticalCenter="0">
<s:layout>
<s:HorizontalLayout/>
</s:layout>
<s:VGroup>
<s:Label text="NumericStepper" fontWeight="bold" backgroundColor="0xff0022"/> <s:NumericStepper id="kids"
minimum="0"
maximum="10"
stepSize="1"
change="showMsg(kids.value.toString())"/> <s:HGroup>
<s:Label text="Spinner" fontWeight="bold" backgroundColor="0xff0022"/>
<s:Spinner minimum="0" maximum="10" id="collegeKids"/>
<s:Label text="{collegeKids.value} in college"/>
</s:HGroup> <s:Label text="HSlider" fontWeight="bold" backgroundColor="0xff0022"/>
<mx:HSlider id="commuteTimeRange" minimum="0" maximum="180"
tickInterval="15"
labels="[0 mins,180 mins]"
thumbCount="2" snapInterval="5"
change="showMsg(commuteTimeRange.values.toString())">
</mx:HSlider> </s:VGroup>
<s:VGroup>
<s:Label text="VSlider" fontWeight="bold" backgroundColor="0xff0022"/>
<mx:VSlider id="yourHeight" minimum="0" maximum="300"
tickInterval="50" snapInterval="1"
labels="[0,50,100,150,200,250,300]"
change="showMsg(yourHeight.values.toString())"/> </s:VGroup>
</s:Panel>
</s:Application>

NumericSample

4、Button组件

外观:

代码:

<?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"> <fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.collections.ArrayCollection; [Bindable]
public var myArray:ArrayCollection = new ArrayCollection(['One','Two','Three']); public function showMsg(msg:String):void
{
Alert.show('You just clicked on ' + msg);
}
]]>
</fx:Script>
<s:Panel title="ButtonSample" width="360" height="240" horizontalCenter="0" verticalCenter="0">
<s:VGroup>
<s:Button id="thisBtn" label="Button" click="showMsg('button')"/> <mx:LinkButton id="thisLinkBtn" label="LinkButton"/> <s:Label text="ButtonBar" fontWeight="bold" backgroundColor="0xff0022"/>
<s:ButtonBar id="thisBtnBar" labelField="ButtonBar"
dataProvider="{myArray}"
click="showMsg(ButtonBar(event.currentTarget).selectedItem)" /> <s:Label text="LinkBar" fontWeight="bold" backgroundColor="0xff0022"/>
<mx:LinkBar id="thisLinkBar"
dataProvider="{myArray}"
itemClick="showMsg(event.label)" /> <s:Label text="ToggleButtonBar" fontWeight="bold" backgroundColor="0xff0022"/>
<mx:ToggleButtonBar id="thisToggleBar"
dataProvider="{myArray}"
itemClick="showMsg(event.label)"/>
</s:VGroup> </s:Panel>
</s:Application>

ButtonSample

5、选单控件

外观:

代码:

<?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">
<fx:Script>
import mx.controls.Alert;
public function showMsg(msg:String):void
{
Alert.show(msg);
}
</fx:Script>
<fx:Declarations>
<s:RadioButtonGroup id="Spam"
itemClick="showMsg('User picked ' +
event.currentTarget.selectedValue)"/>
</fx:Declarations> <s:Panel width="400" height="150" title="SelecterSample" horizontalCenter="0" verticalCenter="0">
<s:layout>
<s:VerticalLayout/>
</s:layout>
<s:HGroup>
<s:Label text="CheckBox" fontWeight="bold" backgroundColor="0xff0022"/>
<s:CheckBox id="cbVideoGames" label="Video Games"
click="showMsg('Video Games is ' + cbVideoGames.selected)"/>
<s:CheckBox id="cbFishing" label="Fishing"
click="showMsg('Fishing is ' + cbFishing.selected)"/>
</s:HGroup>
<s:HGroup> <s:Label fontWeight="bold" text="RadioButton" backgroundColor="0xff0022"/>
<s:RadioButton id="rbYes" value="Yes" groupName="Spam"
click="showMsg('Yes')" label="Yes"/>
<s:RadioButton id="rbNo" value="No" groupName="Spam"
click="showMsg('No')" label="No"/>
</s:HGroup> <s:HGroup>
<s:Label fontWeight="bold" text="DropDownList" backgroundColor="0xff0022"/>
<s:DropDownList id="combo"
close="showMsg('Favorite car is ' +
event.currentTarget.selectedItem)" >
<mx:ArrayCollection>
<fx:String>Ferrari</fx:String>
<fx:String>Porsche</fx:String>
<fx:String>Hyundai</fx:String>
</mx:ArrayCollection>
</s:DropDownList>
</s:HGroup> <s:HGroup>
<s:Label fontWeight="bold" text="ColorPicker" backgroundColor="0xff0022"/>
<mx:ColorPicker id="clr"
change="showMsg('Color ' +
event.currentTarget.selectedColor)"/>
</s:HGroup>
</s:Panel>
</s:Application>

SelecterSample

Flex_控件的更多相关文章

  1. JS调用Android、Ios原生控件

    在上一篇博客中已经和大家聊了,关于JS与Android.Ios原生控件之间相互通信的详细代码实现,今天我们一起聊一下JS调用Android.Ios通信的相同点和不同点,以便帮助我们在进行混合式开发时, ...

  2. HTML5 progress和meter控件

    在HTML5中,新增了progress和meter控件.progress控件为进度条控件,可表示任务的进度,如Windows系统中软件的安装.文件的复制等场景的进度.meter控件为计量条控件,表示某 ...

  3. 百度 flash html5自切换 多文件异步上传控件webuploader基本用法

    双核浏览器下在chrome内核中使用uploadify总有302问题,也不知道如何修复,之所以喜欢360浏览器是因为帮客户控制渲染内核: 若页面需默认用极速核,增加标签:<meta name=& ...

  4. JS与APP原生控件交互

    "热更新"."热部署"相信对于混合式开发的童鞋一定不陌生,那么APP怎么避免每次升级都要在APP应用商店发布呢?这里就用到了混合式开发的概念,对于电商网站尤其显 ...

  5. UWP开发必备:常用数据列表控件汇总比较

    今天是想通过实例将UWP开发常用的数据列表做汇总比较,作为以后项目开发参考.UWP开发必备知识点总结请参照[UWP开发必备以及常用知识点总结]. 本次主要讨论以下控件: GridView:用于显示数据 ...

  6. 【踩坑速记】开源日历控件,顺便全面解析开源库打包发布到Bintray/Jcenter全过程(新),让开源更简单~

    一.写在前面 自使用android studio开始,就被它独特的依赖方式:compile 'com.android.support:appcompat-v7:25.0.1'所深深吸引,自从有了它,麻 ...

  7. 对百度WebUploader开源上传控件的二次封装,精简前端代码(两句代码搞定上传)

    前言 首先声明一下,我这个是对WebUploader开源上传控件的二次封装,底层还是WebUploader实现的,只是为了更简洁的使用他而已. 下面先介绍一下WebUploader 简介: WebUp ...

  8. Windows API 设置窗口下控件Enable属性

    参考页面: http://www.yuanjiaocheng.net/webapi/create-crud-api-1-put.html http://www.yuanjiaocheng.net/we ...

  9. VB.NET设置控件和窗体的显示级别

    前言:在用VB.NET开发射频检测系统ADS时,当激活已存在的目标MDI子窗体时,被其他子窗体遮住了,导致目标MDI子窗体不能显示. 这个问题怎么解决呢?网上看到一篇帖子VB.NET设置控件和窗体的显 ...

随机推荐

  1. 关于在listView中优化的问题 更多方

    面试官 说 需要至少说出8种 (--) 1.convertView的复用,切忌每次getView()都新建.listView的核心原理就是重用view. 2.ViewHolder 减少findView ...

  2. Simple Maven Project

    为pom.xml添加组织,法律和开发人员信息 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=&qu ...

  3. PRCR-1065 Failed to stop resource ora.asm 处理

    在网上看到的一些关闭Oracle Grid Infrastructure教程中,很多在关闭数据后就开始关闭ASM,结果提示如下的错误. [grid@rhvm1 ~]$ srvctl stop asm ...

  4. Git 问题

    You are not currently on a branch, so I cannot use any 症状:有一次pull的时候又出现冲突,这回用“git reset --hard FETCH ...

  5. Sprint第一个冲刺(第九天)

    一.Sprint介绍 建立云端数据库,把注册的内容保存到云端,不易丢失. 实验截图: 任务进度: 二.Sprint周期 看板: 燃尽图:

  6. 20151216Repeater

    Repeater 用法:.绑定数据源 Repeater1.DataSource = context.Info; Repeater1.DataBind(); .造项模版: 头模版:HeaderTempl ...

  7. NodeJS的小应用

    server.js: //引入require 模块 var http=require('http'); //创建服务器 http.createServer(function(request,respo ...

  8. [java] java解析txt文件

    /** * 读取txt文件内容封装为map返回 * @param filePath * @return */ public static String readTxt(String filePath) ...

  9. UIButton的使用

    使用UIButton时需要注意的是: 1.UIButton的创建有专门的类方法(buttonWithType:,UILabel没有): 2.UIButton常用的属性包括:frame.titile.t ...

  10. Oracle数据库的后备和恢复————关于检查点的一些知识

    当我们使用一个数据库时,总希望数据库的内容是可靠的.正确的,但由于计算机系统的故障(硬件故障.软件故障.网络故障.进程故障和系统故障)影响数据库系统的操作,影响数据库中数据的正确性,甚至破坏数据库,使 ...