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
Ïà¹ØÎĵµ£º
FlexʹÓÃLoaderºÍURLRequest¼ÓÔØ±¾µØÍ¼Æ¬Ê¾Àý£º
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[
import mx.core.UIComponent;
import mx.controls.Alert;
import flash.display.*;
i ......
£¨1£©Event Listeners
Listening to parent objects does cause memory leaks
e.g.
& ......
java¿ª·¢µÄ×ÜÏ뾡¿ì°ÑflexºÍjava½áºÏÆðÀ´,ÎÒÒ²ÊÇ,µ«ÕâÈÝÒ׺öÊÓһЩ»ù´¡µÄ¶«Î÷,¸Õ°ÑflexºÍjavaÕûºÏµÄµÚÒ»²½×öÍê,ºöÈ»ÏëÔÚflexÒ³ÃæÖе¯³ö¸ö¶Ô»°¿ò,²»ÖªµÀÔõôдÁË,ÍøÉϲéÁ˰ëÌì²Å³öÀ´.
ÔÀ´ÕâÒ»¾ä»°¾Í¸ã¶¨ÁË
Alert.show(content,title,flags,parent,closeHandle,iconClass,defaultButtonFlag);
ÒÔÏÂÊÇÍøÉÏÕÒµ½×ÊÁÏ,¹©²Î¿¼. ......
¹¹½¨¸ßÐÔÄܵÄJ2EEÓ¦Óò»µ«ÐèÒªÁ˽ⳣÓõÄʵʩ¼¼ÇÉ¡£ÏÂÃæ½éÉÜ×î³£ÓõÄ10ÖÖÓÐЧ·½·¨£¬¿É°ïÖú¼Ü¹¹Éè¼ÆÊ¦ÃÇ¿ìËÙ³ÉΪÕâ·½ÃæµÄר¼Ò¡£
JavaÐÔÄܵĻù´¡—ÄÚ´æ¹ÜÀí
ÈκÎJavaÓ¦Ó㬵¥»úµÄ»òJ2EEµÄÐÔÄÜ»ù´¡¶¼¿É¹é½áµ½ÄãµÄÓ¦ÓÃÊÇÈçºÎ¹ÜÀíÄÚ´æµÄÎÊÌâ¡£JavaµÄÄÚ´æ¹ÜÀí°üÀ¨Á½¸öÖØÒªÈÎÎñ£ºÄÚ´æµÄ·ÖÅäºÍÄÚ´æµÄ»ØÊÕ¡£ÔÚÄÚ´æµÄ·ÖÅäÖУ¬Ä ......
Flex Java Object¶ÔÓ¦¹ØÏµ
ĿǰLCDSÖ»ÄÜÓëJ2EEµÄ·þÎñ¶Ë½øÐÐͨÐÅ£¬ËùÒÔĿǰֻÊÇActionScript 3.0Êý¾ÝÀàÐͺÍJavaÊý¾ÝÀàÐ͵Äת»»¡£ActionScript 3.0ÓëJavaÊý¾ÝÀàÐÍת»»ÊDz»¶Ô³ÆµÄ¡£
ActionScript3.0ÏòJavaת»»Ê±Êý¾ÝÀàÐ͵ĶÔÓ¦¹ØÏµ
ActionScriptÊý¾ÝÀàÐÍ -------------------JavaÊý¾ÝÀàÐÍ
null -------------------null ......