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. Android 优化List图片显示

    通常在界面中涉及到大量图片加载的时候都会产生卡顿,因此需要优化 其核心思想就是减少在getView()中的代码量和操作,让其尽可能的轻量化.众多方法最根本的目的是 将一切耗时的操作从getView中抽 ...

  2. Android RecyclerView单击、长按事件:基于OnItemTouchListener +GestureDetector标准实现(二),封装抽取成通用工具类

     Android RecyclerView单击.长按事件:基于OnItemTouchListener +GestureDetector标准实现(二),封装抽取成通用工具类 我写的附录文章2,介绍了 ...

  3. PAT (Basic Level) Practise:1016. 部分A+B

    [题目链接] 正整数A的“DA(为1位整数)部分”定义为由A中所有DA组成的新整数PA.例如:给定A = 3862767,DA = 6,则A的“6部分”PA是66,因为A中有2个6. 现给定A.DA. ...

  4. 2015GitWebRTC编译实录10

    2015.07.20 rtc_p2p编译通过[879/1600 ] CXX obj /webrtc/p2p/client/rtc_p2p.httpportallocator.o[880/1600 ] ...

  5. PyCharm/IntelliJ IDEA Golang开发环境搭建(最方便快捷的GO语言开发环境)

    IntelliJ太牛了.为了配置Go语言开发环境,折腾了半天,下IDE(Sublime Text,IntelliJ Idea),然后装Go插件.装Go插件还要下载插件项目源码,编译等等,Sublime ...

  6. SQL Server 2012 使用警报调度数据库作业通知操作员

    如果想让数据库满足某种条件时,触动警报,然后执行一系列作业,并通知管理员,则需要配置警报 比如,当数据库日志达到一定大小如10M时触动警报,执行以下3个作业步骤:备份日志.收缩日志文件到2M.完备数据 ...

  7. windows下用一台机器配置分布式redis(主从服务器)

    目录1.Replication的工作原理2.如何配置Redis主从复制 1.Replication的工作原理在Slave启动并连接到Master之后,它将主动发送一条SYNC命令.此后Master将启 ...

  8. FileUploadInterceptor拦截器的笔记

    当请求表单中包含一个文件file,FileUploadInterception拦截器会自动应用于这个文件. 表单: <s:form namespace="/xxx" acti ...

  9. SESSION和COOKIE的作用和区别,SESSION信息的存储方式,如何进行遍历?

    二者的定义:当你在浏览网站的时候,WEB 服务器会先送一小小资料放在你的计算机上,Cookie 会帮你在网站上所打的文字或是一些选择,都纪录下来.当下次你再光临同一个网站,WEB 服务器会先看看有没有 ...

  10. 在CentOS 7中安装nginx服务器

    简要地介绍一下,如何在CentOS 7中安装nginx服务器  下载对应当前系统版本的nginx包(package) # wget  http://nginx.org/packages/centos/ ...