ÕâÒ»´ÎµÄFlex ʵ¼ù½«ÒªÊµÏÖÒÔϹ¦ÄÜ£º
1¡¢×Ô¶¨ÒåÒ»¸ö¼òµ¥µÄ Flex ×é¼þ
2¡¢´´½¨Ò»¸öIndex. mxml À´µ÷ÓøÃ×é¼þ
1£©Óà as µ÷ÓÃ×é¼þ
2£©Óà mx ±êÇ©µ÷ÓÃ×é¼þ
Ê×ÏÈ´´½¨ÐÂÎļþ¼Ð£¨user£©À´±£´æËùÓÐ×Ô¶¨ÒåµÄ×é¼þ£¬ÕâÀïÎÒ½«Ð´´½¨µÄ×é¼þÃüÃûΪ£ºUserView.mxml
ÔÚÖ÷Ŀ¼Ï´´½¨ Mxml Application£¬ÕâÀïÎÒ½«ËüÃüÃûΪ£ºIndex.mxml
¹¤³ÌÊÓͼΪ£º
ÏÂÃ棬À´Íê³É×é¼þµÄÉè¼Æ£º
ÔÚDesign ÊÓͼϽ«¿Ø¼þÍϵ½Panel ÉÏ£¬ÉèÖÃÆäÊôÐÔ
ÏÂÃæÊÇÎÒµÄÉè¼Æ£º
´úÂë
DesignÊÓͼ
½ÓÏÂÀ´£¬À´Íê³ÉÖ÷Ò³ÃæIndex.mxmlµÄÉè¼Æ
& ......
Ò»¡¢HTTPService
³ÌÐò´úÂ룺
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initializeHandler(event)">
<mx:Script>
<!--[CDATA[
private function initializeHandler(event:Event):void {
countriesService.send();
}
private function changeHandler(event:Event):void {
statesService.send();
}
]]>
</mx:Script>
<!-- ÔØÈë´¿¾²Ì¬µÄxmlÊý¾Ý -->
<mx:HTTPService id="countriesService" url="http://www.rightactionscript.com/states/xml/countries.xml" />
<!-- ÔØÈëÓÉphpÉú³ÉµÄxmlÊý¾Ý -->
<mx:HTTPService id="statesService" url="http://www.rightactionscript.com/states/xml/states.php">
<!-- ÒÔϱêÇ©¾ÍÊÇÒª·¢Ë͵½·þÎñ¶ËµÄÊý¾ÝÁË,¿ÉÒÔÕâÑùÀí½â:ÓÐÒ»¸öÃûΪcountryµÄ±äÁ¿,ËüµÄֵΪ»¨À¨ºÅ{}ÀïµÄÄÚÈÝ -->
<mx:request>
<country>{country.value}</country>
</mx:request>
</mx:HTTPService>
<mx:VBox>
<!-- ´Ë¿Ø¼þµÄÊý¾ÝÓɵÚÒ»¸ö<mx:HTTPSer ......
·½·¨Ò»£º
<?xml version="1.0"?>
<!-- events/MultipleEventHandlersInline.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script><![CDATA[
private function submitForm(e:Event):void {
// Handle event here.
}
private function debugMessage(e:Event):void {
// Handle event here.
}
]]></mx:Script>
<mx:Button id="b1"
label="Do Both Actions"
click='submitForm(event); debugMessage(event);'
/>
</mx:Application>
·½·¨¶þ£º
<?xml version="1.0"?>
<!-- events/MultipleEventHandlersAS.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="createHandlers(event)">
<mx:Script><![CDATA[
public function createHandlers(e:Event):void {
b1.addEventListener(MouseEvent.CLICK, submitForm);
b1.addEventListener(M ......
<?
xml
version
=
"1.0"
?>
<!-- Simple example to demonstrate the Alert control. -->
<
mx:Application
xmlns:mx
=
"http://www.adobe.com/2006/mxml"
>
<
mx:Script
>
<![CDATA[
import mx.controls.Alert;
import mx.events.CloseEvent;
// Event handler function uses a static method to show
// a pop- ......
×î¼òµ¥µÄ·½·¨ÊDZ¾µØ»¯±àÒ룬¼´±àÒ벻ͬµÄÓïÑÔ°æ±¾
£¬È»ºóʹÓÃ
Application Server
À´Åж¨¿Í»§Ê¹ÓõÄÊÇÄÄÖÖÓïÑÔ£¬²¢×Ô¶¯Ö¸Ïò¶ÔÓ¦µÄ
swf
Îļþ¡£
¾ßÌå×ö·¨ÈçÏ£º
ÔÚÏîÄ¿Éϵã»÷ÓÒ¼ü£¬Ñ¡Ôñ
Properties
¡£
È»ºóÑ¡Ôñ
Flex Compiler
£¬ÔÚ
Additional Compiler arguments
ÏÂÃæÒѾÅäÖúÃÓïÑÔ°üÁË£¬Ä¬ÈÏΪ
-locale en_US
¡£
ÕâʱÎÒÃÇ¿ÉÒÔÓÃÒ»¸ö
locale
Ŀ¼À´¼òµ¥¶¨ÖÆÎÒÃǶîÍâÉèÖ㨵±È»²»°üÀ¨
Flex
ÄÚ
²¿¿Ø¼þµÄÓïÑÔ£©
µÄ
ÓïÑÔÉèÖá£
±ÈÈç¸ÄΪ£º
-locale=en_US
-source-path+=g:\flexproj\locale\{locale}
¡£ÕâÑùÔÚ
g
ÅÌ
µÄ
flexproj
Ŀ¼Ï½¨Á¢Ò»¸ö
locale
Ŀ¼¡£
È»ºóĿ¼Ï·ÅÖðüº¬ÎÒÃÇÒªÀ©Õ¹µÄÓïÑÔÎļþµÄÎļþ¼Ð¾Í¿ÉÁË¡£±È
Èç
£º
g:\flexproj\locale\en_US
¡£
×¢Ò⣺
locale
ÏÂÃæµÄĿ¼ÃûÓ¦¸ÃºÍ
-locale=
ÉèÖõÄÃû³ÆÒ»Ö¡£
ÄÇôÕâÑù£¬ÎÒÃǾͿÉÒÔʹÓöîÍâµÄÓïÑÔÉèÖÃÁË¡£
Àý£º
Additional Compiler arguments
ÅäÖÃΪ
-locale+=en_US
-source-path+=g:\flexproj\testgoufang\locale\{locale}
È»ºóÔÚ¶ÔÓ¦µÄ
locale
Ŀ¼ÏÂÌí¼Ó¹ú¼Ê»¯×ÊÔ´Îļþ
g:\flexproj\testgoufang\locale\en_US\strings.properties
ÕâÒ»²¿·Ö¸ú
struts
Ï ......
ÏÖÔÚflash builder 4ÒѾ×Ô´øÁ˶àÖÖÓïÑÔ°ü£¬ÔÚʹÓõÄʱºòÖ±½ÓÄùýÀ´ÓþͿÉÒÔÁË£¬ÔÚʹÓÃ×ÊÔ´ÎļþµÄʱºò£¬ÐèÒªÉèÖÃÒ»ÏÂ×ÊÔ´²ÎÊý
-locale=en_US,zh_CN -source-path=locale/{locale}
flex 3.xµÄ°æ±¾µÄsdkÖ»Ö§³ÖÓ¢ÎĺÍÈÕÎÄ£¬Èç¹ûÐèÒªÖÐÎÄ£¬Ôò¿ÉÒÔ´Óflex
4.xsdkµÄ\frameworks\locale¿½±´zh_CNµÈÎļþ¼Ðµ½flex3.xµÄ\frameworks\localeĿ¼Ï¾ͿÉÒÔÁË
-locale=en_US,zh_CNÕâÀïÊÇÄãÉèÖÃÒªÖ§³ÖµÄÓïÑÔ£¬ÒÔ","
¸ô¿ª£¬-source-path=locale/{locale}ÊÇÏà¶ÔÏîÄ¿¸ùĿ¼locale/{locale}ÕâÀïÊÇÏà¶ÔsrcµÄ£¬ÊÇÔÚsrc
/localeÎļþ¼ÐϵÄ×ÊÔ´Îļþ£¬²¢ÇÒ£¬ÐèÒªÃüÃûen_US£¬zh_CN×ÊÔ´Îļþ¼Ð,²¢ÇÒ×ÊÔ´ÎļþµÄÃû³Æ±ØÐëÒ»Ö¡£-source-
path=locale/{locale}ºóµÄlocale/{locale}Ò²¿ÉÒÔʹ¾ø¶Ô·¾¶ÀýÈçD:/workspace/locale
/{locale},
ÀýÈç×ÊÔ´ÎļþÃû³Ælanguage.properties
ÀïÃæµÄÄÚÈÝΪ
en_US
user=username
pass=passowrd
zh_CN
user=ÐÕÃû
pass=ÃÜÂë
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml
"
layout="absolute" minWidth="1024" minHeight=" ......