Flex no.2
来源:互联网 发布:打棒球的好处 知乎 编辑:程序博客网 时间:2024/04/29 01:32
--------------ex2_01_solution 选取时间-----------------------
...
private function dateChangeHandler():void
{
// The Alert.show() message displays a static string plus the selected date in the startDate control
Alert.show('You have selected ' + startDate.selectedDate.toDateString());
}
...
<mx:DateChooser id="startDate"
x="34" y="94"
showToday="true"
change="dateChangeHandler()"/>
--------------ex2_2_solution 选取时间-----------------------CalendarLayoutChangeEvent
protected function dateChangeHandler(event:CalendarLayoutChangeEvent):void
{
if ((event.target.id == "endDate") && (startDate.selectedDate > endDate.selectedDate))
{
Alert.show("Start date must be scheduled before end date.");
}
}
....
<mx:DateChooser id="startDate"
x="34" y="94"
showToday="true"
change="dateChangeHandler(event)"/>
--------------ex2_3_solution 选取时间-----------------------addEventListener
<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/halo"
minWidth="1024" minHeight="768"
creationComplete="initApp()">
...
private function initApp():void
{
// Add the event listener using ActionScript instead of inline in the DateChooser instances
startDate.addEventListener(CalendarLayoutChangeEvent.CHANGE, dateChangeHandler);
endDate.addEventListener(CalendarLayoutChangeEvent.CHANGE, dateChangeHandler);
}
--------------ex2_4_solution 选取时间-----------------------Formatting dates
<fx:Declarations>
<mx:DateFormatter id="dateInputFormatter"
formatString="MM-DD-YYYY"/>
</fx:Declarations>
...
<mx:FormItem label="Date:">
<!-- use the format() method of the formatter instance to specify the data to format -->
<s:TextInput text="{dateInputFormatter.format(dateSelector.selectedDate)}"/>
<mx:DateChooser id="dateSelector"/>
</mx:FormItem>
--------------ex2_5_solution 提交表单-----------------------Validating form data
<fx:Declarations>
<mx:DateFormatter id="dateInputFormatter"
formatString="MM-DD-YYYY"/>
<mx:NumberValidator id="hourValidator"
precision="2"
allowNegative="false"
required="true"
source="{hoursInput}"
property="text"
triggerEvent=""/>
<mx:EmailValidator id="empIdValidator"
source="{empIdInput}"
property="text"
triggerEvent=""/>
<mx:DateValidator id="dateInputValidator"
source="{dateInput}"
property="text"
triggerEvent=""/>
</fx:Declarations>
--------------ex2_6_solution 通过title来显示不同的组件-----------------------Navigating using MX navigator containers
<mx:LinkBar dataProvider="{employeeDepartments}"/>
...
<mx:ViewStack id="employeeDepartments"
resizeToContent="true"> <!--调整内容大小-->
<components:HumanResources label="Human Resources"/> <!--引用自定义类-->
<components:Marketing label="Marketing" />
<components:InformationTechnology label="Information Technology" />
</mx:ViewStack>
--------------ex2_7_solution 切换登陆,主页界面-----------------------Creating and navigating application states
step1
step2
这里注意的就是“Employee of the Month”panel会根据不同的页面显示在不同的地方。故看此处:
<s:Panel id="employeeOfTheMonth"
title="Employee of the Month"
x="24" y="112"
x.loginState="298" y.loginState="111"
width="177" height="169"
width.loginState="264">
蓝色是在 loginState状态下的位置。
红色是在 非loginState状态下的位置。
- Flex no.2
- FLEX no.3
- 从头学FLEX no.1
- [Flex 2] 02 Flex
- [Flex 2] 06 Flex & XML
- NO.2
- No.2
- no.2
- flex Accordion 导航器容器2 flex 教程 flex培训 flex源码 flex实例
- flex datagrid 添加树2 flex 教程 flex培训 flex源码 flex实例
- Flex学习笔记[2] - Flex 编程基础
- flex入门2-flex基本语法
- flex基础(2)
- Flex 2 DataGrid 分页
- Flex 2 Metadata Tags
- Professional Adobe Flex 2
- flex知识点2
- 自定义Flex组件(2)
- 通过xmanager远程连接redhat linux as 5
- 删除字符串空格
- SQL Server中CASE的用法
- “开源”的Windows XP
- 位操作的几个函数
- Flex no.2
- 博客计划
- samba的share模式與SELinux的關係
- 基于KPI的IT管理
- shmget() -- 建立共享内存
- 111111111111111
- 标准BOM,啥玩意,该废除了!
- u-boot1.1.6移植 DM9000
- IIS修改注册表扩大内存使用