Àí½â Flex itemRenderer µÚ 4 ²¿·Ö: ״̬ºÍ¹ý¶É
ÔÎĵØÖ·£ºhttp://www.adobe.com/cn/devnet/flex/articles/itemrenderers_pt4.html
itemRenderer ×îÉó¤ÓëÓ¦ÓóÌÐòµÄÓû§Í¨ÐÅ¡£ÓÐʱͨÐźܼòµ¥, Ö»ÊÇÏÔʾһ¸öÃû³Æ£»ÓÐʱ»áʹÓøü¾«ÖµÄÑÕÉ«£»ÓÐʱ¾ßÓн»»¥ÐÔ¡£
itemEditor ÊÇÕæÕýµÄ½»»¥¿ØÖÆ, µ«ËüÃDz»ÊDZ¾ÎĵÄÖص㡣ÔÚÕâЩʾÀýÖÐ, ÎÒ½«ÏòÄúչʾ¸ù¾ÝÊý¾Ý±¾Éí»òÓû§²Ù×÷¸ü¸Ä¿ÉÊÓÍâ¹ÛµÄ itemRenderer¡£
±¾ÏµÁаüº¬ÒÔÏÂÎÄÕÂ:
µÚ 1 ²¿·Ö: ÄÚÁªäÖȾÆ÷
µÚ 2 ²¿·Ö: ÍⲿäÖȾÆ÷
µÚ 3 ²¿·Ö: ͨÐÅ
µÚ 4 ²¿·Ö: ״̬ºÍ¹ý¶É
µÚ 5 ²¿·Ö: ЧÂÊ
񻂗
ΪÁ˳ä·ÖÀûÓñ¾ÎÄ, ÄúÐèÒªÒÔÏÂÈí¼þºÍÎļþ:
Flex Builder 3
±ØÒªÌõ¼þ:
Òª´Ó±¾ÎÄÖÐÊÜÒæ, Äú×îºÃÊìϤ Flex Builder ºÍ ActionScript 3.0¡£
״̬
Flex <mx:State> ÊǸü¸Ä itemRenderer Íâ¹ÛµÄÒ»¸öÀíÏë·½·¨¡£×´Ì¬Ê¹Óüò±ã, ²¢ÇÒÓë¹ý¶É½áºÏʹÓÃʱ, ¿ÉÒÔΪÓû§Ìṩ·´À¡ºÍÓäÔõÄÌåÑé¡£
ÔÚ±¾ÀýÖÐ, Äú½«ÎªÁбíн¨Ò»¸ö MXML itemRenderer£¨¼Çס, Èç¹ûÄúÔ¸Òâ, ÍêÈ«¿ÉÒÔʹÓà ActionScript ÕâÑù×ö£©¡£Õâ¸ö itemRenderer ÏÔʾͼÏñ¡¢ÊéÃû¡¢×÷Õß¡¢¼Û¸ñÒÔ¼°ÓÃÓÚ¹ºÂòÕâ±¾Êé¼®µÄ Button¡£
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="/2006/mxml">
<mx:Image id="bookImage" source="{data.image}" />
<mx:VBox height="115" width="100%" verticalAlign="top" verticalGap="0" paddingRight="10">
<mx:Text text="{data.title}" fontWeight="bold" width="100%"/>
<mx:Label text="{data.author}" />
<mx:HBox id="priceBox" width="100%">
<mx:Label text="{data.price}" width="100%"/>
<mx:Button label="Buy" />
</mx:HBox>
</mx:VBox>
</mx:HBox>
µ«ÊÇ, ÄúÏëҪʵÏÖµÄÊÇ, Èç¹ûÊé¼®ÊÛ¿Õ£¨Êý¾Ý°üº¬ <instock> ½Úµã, ËüÃÇÊÇ yes »ò no£©, ¼Û¸ñºÍ“¹ºÂò”Button »áÏûʧ¡£ÎÒΪ¼Û¸ñºÍ Button µÄ HBox ¸¸´úÔö¼ÓÁËÒ»¸ö id ÊôÐÔ, ʹ´Ë´¦µÄ±àÂë¸ü¼òµ¥Ò»Ð©¡£ÕâÑù, ÎÒ¿ÉÒÔͨ¹ý¸ü¸Ä HBox ºÍ priceBox µÄ¿ÉÊÓÐÔÀ´¸ü¸ÄÄÇЩÏîÄ¿µÄ¿ÉÊÓÐÔ¡£
ͨ¹ý¸²¸Ç set data º¯Êý¿ÉÒÔÕâÑù×ö, Äú½«»áÕâô×ö, µ«²»ÊÇÖ±½Ó¸ü¸Ä priceBox µÄ¿ÉÊÓÐÔ, ¶øÊÇʹÓÃÒÔÏÂ״̬¶¨Òå:
<mx:states>
<mx:State name="NoS
Ïà¹ØÎĵµ£º
FlexµÄʼþÆäʵºÜÈÝÒ×Ã÷°×£¬ÏóJAVAÓïÑÔÒ»Ñù£¬¸øij¸ö¿Ø¼þ×¢²áÒ»¸ölistener£¬È»ºóʼþ·¢ÉúµÄʱºò´¥·¢ÏàÓ¦µÄº¯Êý£¬ÕâµãÎÒÏàÐÅ´ó¶àÊýÈ˶¼Äܹ»Ã÷°×¡£½ñÌìÎÒÏëҪ˵µÄ²»ÊÇÕâ¸ö£¬¶øÊǸü¼Óϸ½ÚµÄһЩ¶«Î÷¡£
1.ʼþµÄ´«²¥¹ý³Ì¡£
FlexʼþÓÐÏÂÃæÈý¸ö½×¶Î£¬µ±Ê¼þ·¢ÉúʱÒÀ´ÎΪ£º
1.capturing£¨²¶×½£©
2.targeting£¨Ä¿±ê£©
3.bubbli ......
ÔÚflexÖÐÒ²¾³£»áÓõ½½Øͼ¹¦ÄÜ£¬²¢ÇÒ½«½ØͼµÄͼƬ±£´æÖÁ±¾µØ¡£Ò»Ï뵽ͼƬÄÇôÎÒÃǾÍ×ÔÈ»Ïëµ½ËûµÄ´æÔÚÐÎʽ bitmap byteArray.ËùÒÔ×ÔÈ»¾Í»áÁªÏµµ½bitmapÀàÉÏÈ¥¡£
ÏÂÃæÈÃÎÒÃÇÒ»ÆðÀ´¿´¿´¶¼ÓÐÄÄЩ·½·¨°É¡£
·½·¨Ò»£º°´ÎÒÃÇ×ÔÈ»µÄ˼·ʵÏÖ£º
ÔÚapplicationÖÐÓÐÁ½¸öÈÝÆ÷£º
<mx:Canvas id="virtour_cav" top="0" bottom="0" l ......
ÔÚ.netÖУ¬ÎÒÃÇ¿ÉÒÔÓÃ"²ã"À´²¼¾Ö£¬ÊµÏֿؼþµÄÉÏÏÂÖصþ¡£
ÔÚflexÀïòËÆÊÇûÕâ¸ö¸ÅÄîµÄ£¬flex°´Ä¬ÈÏÊÇÈÏΪÏȶ¨ÒåµÄÔÚϲ㣬ºó¶¨ÒåµÄÔÚÉϲ㣬²»ÂÛÊÇÊÂÏȶ¨ÒåµÄ¿Ø¼þ£¬»¹ÊÇ´úÂ붯̬Éú³ÉµÄ¿Ø¼þ£¬¶¼ÊÇÏÈÀ´¾ÓÏ¡£
µ«ÊÇflexÓÐ×Ô¼ºµÄµ÷Õûº¯Êý£¬×ÜËãÊÇÈÃÎҲ鵽ÁË¡£
ÈÝÆ÷Ãû.setChildIndex(displayObject,int)¾ÍÊǵ÷ÕûÕâ¸öÈÝÆ÷ÏÂËùÓп ......
Flex for eclipse²å¼þ£¬¹ËÃû˼Ò壬¾ÍÊÇ¿ÉÒÔÔÚEclipseϽøÐÐFlex¿ª·¢µÄ²å¼þ¡£ÏÂÃæ½éÉÜÕâ¸ö²å¼þµÄ°²×°·½·¨¡£
°²×°Flex for eclipse²å¼þ£¬ºÍ°²×°EclipseÆäËüµÄ²å¼þ·½·¨¶¼ÊÇÒ»ÑùµÄÓÐÁ½ÖÖ·½Ê½£ºÒ»ÊÇÖ±½Ó½«features,pluginsÁ½¸öÎļþ¼ÐÓëEclipseµÄºÏ²¢£»ÁíÒ»ÖÖÊÇͨ¹ýlinkµÄ·½Ê½£¬ÏÂÎÄÊǽéÉÜÈçºÎͨ¹ýLinkµÄ·½Ê½°²×°£®
1,ͨ¹ýlink· ......
1) ±àÒëCSS×ÊÔ´
Îļþä¯ÀÀÆ÷£¨Navigator£©ÖУ¬ÔÚ±ê×¼µÄFlex CSSÎļþÉϵã»÷ÓÒ¼ü£¬µã»÷Compile CSS to SWF¼´¿ÉÍê³É±àÒëCSSµÄÈÎÎñ¡£
ÔÚ³ÌÐòÖпÉÒÔÓÃStyleManager.loadStyleDeclarations()À´¶Á³öÒѱàÒëºÃµÄCSSÎļþÖеÄÄÚÈÝ¡£
¾ßÌå²Ù×÷ÈçÏÂ:
&nbs ......