¹ØÓÚflex µÄ¼¸ÖÖ°ó¶¨
µÚÒ»ÖÖ£¬Ê¹ÓÃ{}°ó¶¨
<mx:TextInput
id=
"input"
/>
<mx:Label
text=
"{input.text}"
/>
µÚ¶þÖÖ£¬<mx:Binding> °ó¶¨
<mx:Application
xmlns:mx=
"http://www.adobe.com/2006/mxml"
layout=
"vertical"
>
<mx:TextInput
id=
"inputSource"
/>
<mx:Label
id=
"labelTarget"
/>
<mx:Binding
source=
"inputSource.text"
destination=
"labelTarget.text"
/>
</mx:Application>
µÚÈýÖÖ£¬Ê¹Óà BindingUtils¹¤¾ßÀà
BindingUtils
.
bindProperty
(
target
,
"targetProperty"
,
source
,
"sourceProperty"
);
target:Object - Ä¿±ê
targetProperty:Ä¿±êÊôÐÔ£¬StringÀàÐÍ
source:Object - °ó¶¨Ô´
sourceProperty:Ô´ÊôÐÔ£¬StringÀàÐÍ
<mx:Application
xmlns:mx=
"http://www.adobe.com/2006/mxml"
layout=
"vertical"
>
<mx:TextInput
id=
"inputSource"
/>
<mx:Label
id=
"labelTarget"
/>
</mx:Application>
<script>
BindingUtils
.
bindProperty
(labelTarget,"text",inputSource,"text");
</script>
Ïà¹ØÎĵµ£º
ÏîÄ¿ÖУ¬Óû§×Ô¶¨ÒåÍ·Ïñ¹¦ÄÜÒªÇóʵÏÖÓû§×Ô¶¨ÒåÍ·Ïñ£¬²¢ÇÒ¿ÉÒÔ×ÔÓÉÑ¡ÔñͼƬָ¶¨ÇøÓò×÷ΪͷÏñÏÔʾ¡£ ڤ˼¿àÏ룬ÕÒÁ˰ëÌì×ÊÁÏ£¬ÖÕÓÚÕÒµ½Ò»ÆªÏà¹ØÎÄÕ£¬²¢ÌṩÁËÔ´´úÂë¡£ËäÈ»ÑÛ¿´ÓÐÁËüĿ£¬µ«ÊÇËÆÐзÇÐС£ http://www.flashas.net/html/flashasyy/20080423/2950.html £ ......
¿´Á˺ܶàFlexµÄÊ飬¹ØÓÚFlexµÄÉúÃüÖÜÆÚ×ÔÈÏΪÁ˽âµÄ»¹²»´í£¬µ«ÊÇͻȻÉÏÍøÉÏ¿´µ½Ò»¸ö¸çÃÇÓÃͼ±í°ÑFlex µÄApplicationÆô¶¯¹ý³ÌÒÔ¼°×Ô¶¨Òå×é¼þµÄÉúÃüÖÜÆÚ±í´ïµÄ·Ç³£ÇåÎú£¬ºÜÊÇÅå·þ£¬ÌØ·ÖÏí³öÀ´£¬ÄÚÈÝÈçÏ£º
Flex Custom Component LifeCycle
ÓÉ jexchan
׫д
¡¡http://blog.ityao.com/archives/169
......
<?xml version="1.0"?>
<!-- charts/MemoryGraph.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
initialize="initTimer()">
<mx:Script>
<!--[CDATA[
import flash.utils.Timer;
import flash.events.TimerEve ......
<?xml version="1.0"?>
<!-- charts/DataPointAlert.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<!--[CDATA[
import mx.controls.Alert;
import mx.charts.events.ChartItemEvent;
import mx.collections.Array ......