Flex no.2
--------------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(CalendarLayoutChange
相关文档:
<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the DateTimeAxis class. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
import mx.collections.ArrayCollection;
......
<!-- -->
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;
mso-font-charset:2;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
{font-family:宋体;
panose-1:2 ......
java开发的总想尽快把flex和java结合起来,我也是,但这容易忽视一些基础的东西,刚把flex和java整合的第一步做完,忽然想在flex页面中弹出个对话框,不知道怎么写了,网上查了半天才出来.
原来这一句话就搞定了
Alert.show(content,title,flags,parent,closeHandle,iconClass,defaultButtonFlag);
以下是网上找到资料,供参考. ......
Flex Java Object对应关系
目前LCDS只能与J2EE的服务端进行通信,所以目前只是ActionScript 3.0数据类型和Java数据类型的转换。ActionScript 3.0与Java数据类型转换是不对称的。
ActionScript3.0向Java转换时数据类型的对应关系
ActionScript数据类型 -------------------Java数据类型
null -------------------null ......