Flexʼþ»úÖÆ»ù´¡(Ò»)
ºÜ¶à¿ª·¢ÈËÔ±¶¼ÖªµÀÈçºÎʹÓÃʼþ»úÖÆ£¬µ«È´²»Àí½âʼþ»úÖÆµÄ»ù±¾¹¤×÷ÔÀí¡£ÔÚÕâÀïÎÒÃÇ̽ÌÖÒ»ÏÂActionScript 3µÄʼþ»úÖÆ(ÎÞÂÛÊÇÐÂÊÖ»¹ÊÇÀÏÊÖ£¬ÎÒÏàÐÅ¿´µ½×îºó¿Ï¶¨¶ÔÄãÓÐËù°ïÖú )¡£
1. Ê×ÏÈÀ´¿´Ò»ÏÂʼþ»úÖÆÖеö»ù±¾¸ÅÄ
event objects(ÕâÀïÎÒÃǹÃÇÒ½ÐËüʼþ¶ÔÏó)£ºËùÓеÄʼþ¶ÔÏó¶¼ÊÇflash.events.Event»òÕ߯ä×ÓÀà¡£±ÈÈç˵Êó±êʼþMouseEvent£¬¼ÆÊ±Æ÷ʼþTimerEvent¡£Ã¿¸öʼþ¶ÔÏóÖж¼°üÀ¨Ê¼þÀàÐÍ(type)ºÍʼþÔ´(target)£¬±ãÓÚevent listenerÖªµÀ¸ÃʼþµÄÀàÐÍÒÔ¼°ÊÇËÅ׳öÕâÑùµÄʼþ¡£
event dispatchers(¹ÃÇÒ½ÐËüʼþÔ´):ÊÇʼþ·¢ÆðµÄÖ÷Ìå¡£ËùÓеÄdispatcher¶¼ÊÇEventDispatcher»òÆä×ÓÀࡣʼþ´¥·¢Ô´±ØÐëÌṩAPIÈÃlistener½øÐжԸÃʼþµÄ×¢²á(register)¡£
event listeners(¹ÃÇÒ½ÐËüʼþ¼àÌýÆ÷):ÔÚAS 3.0ÖÐËüÍùÍù±íÏÖΪһ¸öº¯Êý¡£ÎÒÃDZØÐëΪÿ¸öÌØÊâµÄʼþºÍʼþÔ´×¢²áÒ»¸ö¼àÌýÆ÷£¬µ±Ê¼þ·¢ÉúµÄʱºò£¬Ê¼þÔ´(dispatcher)»á֪ͨ¸Ã¼àÌýÆ÷È¥´¦ÀíÖÆ¶¨µÄʼþ¡£
2. ÈçºÎ×¢²á¼àÌýÆ÷(registering Listener)
ÔÚAS 3.0ÖпÉÒÔͨ¹ýÏÂÃæµÄÓï·¨¸ñʽ½øÐÐ×¢²á¡£
dispatcher.addEventListener(eventName, listener);
µ±È»ÔÚFlexÖл¹ÓÐÁíÍâÒ»ÖÖ¸ñʽ£¬ÔÚmxmlÎļþÖжÔÒ»¸ö¿Ø¼þµÄʼþÖ±½ÓÖÆ¶¨Ò»¸ö´¦Àíº¯Êý£¬Èç
<mx:Button label="TestClick" click="clickHandler()"/>
3. ÈçºÎɾ³ý¼àÌýÆ÷(removing Listener)
ÔÚAS 3.0ÖÐÒÔÏÂÃæµÄ¸ñʽ½øÐÐɾ³ý
circle.removeEventListener(MouseEvent.CLICK, onClick);
Ó¦¸ÃºÜÈÝÒ×Àí½â¡£
µ«ÕâÀïÈ·ÓÐÒ»µãºÜÖØÒª£º¾¡Á¿É¾³ýÄãÒѾ²»ÔÙʹÓõÄʼþ¼àÌýÆ÷£¬Õâ¸öÉæ¼°µ½Flex ÄÚ´æÐ¹Â©µÄÎÊÌ⣬ÒÔºó»áÓÐÏêϸ½éÉÜ¡£
ת×Ô£ºhttp://wmcai.blog.163.com/blog/static/48024200782442026437/
Ïà¹ØÎĵµ£º
½ñÌìÔÚÐÞ¸ÄÒ»¸öÓÎÏ·bugÎÊÌâµÄʱºòÓöµ½µÄ
ÕâÓÎÏ·±¾À´ÊÇÖÐÎİæµÄ£¬ºóÀ´±»·Òë³ÉÓ¢ÎÄÁË£¬Ó¢ÎĵÄ×Ö·û´®µÄ³¤¶ÈÒ»°ã¶¼»á±ÈÖÐÎĵÄ×Ö·û¶àµÄ£¬ËùÒԺܶàÇé¿öÏÂÒª¼Ó¹ö¶¯ÌõÁË
½ñÌìÓÖÓиöÏÔʾÎÄ×Ö²»È«µÄ£¬Ô±¾ÓõÄÊÇtext±êÇ©µÄÄǸö²»ÄÜÏÔʾ¹ö¶¯ÌõËùÒÔÓÃtextareaÌæ»»µôÁË£¬¿ÉÊǾ¹È»Ã»Óз´Ó¦²»ÏÔʾ¹ö¶¯Ìõ
ÓôÃÆ£¡£¡£¡£¡
ÎÒÌí¼ÓÁË ......
Flex/Flash Ö§³ÖµÄÊý¾ÝͨѶ·½Ê½ÓУº
http URLLoader
SOAP(webservice)
json
xml
flash remoting / AMF3
xmlsocket
socket(¶þ½øÖÆ)(×Ô¶¨ÒåÐÒé)
¸ß²¢·¢µÄÓ¦ÓÃÖÐÓû§×´Ì¬¿ÉÒÔÓÃcookie£¬²»ÓÃsession
Èç¹ûÊǶàÈËʵʱ½»»¥ÈçÁÄÌìϵͳ£¬¶àÈËÔÚÏß»¥¶¯µÈÓ¦ÓÃÄ£¿é¡¡ÐèÒªÓÃsocket½øÐÐͨѶ(Óë·þÎñÆ÷½¨Á¢³¤Á¬½Ó)£¬·þÎñÆ÷¶Ë¿ÉÒÔ× ......
<mx:TextInput id="userName" maxChars="4" restrict="a-zA-Z" />
restrictÊôÐÔȷʵ¿ÉÒÔÊäÈëÕýÔò±í´ïʽ£¬½øÐÐÊäÈëµÄÑéÖ¤¡£
µ«ÊÇÔÚ³ÌÐòÖ´ÐеÄʱºòÈç¹ûΪuserName.text = "999"»¹ÊÇ¿ÉÒԳɹ¦µÄ¡£
´ýÐø¡£¡£¡£¡£Ñ§Ï°ÖС£¡£¡£ ......
Ò»¡¢Application³£ÓõÄʼþ
initialize=============>³õʼ»¯
createcomplate==========>ÔªËØ¼ÓÔØÍê
initialize·¢ÉúÔÚcreatecomplate֮ǰ¡£
¶þ¡¢Êý¾ÝÇëÇó˵Ã÷
HTTPService==========>httpÊý¾ÝÇëÇó¡£
SOAP(Simple Object Access Protocal)=======> webService
AMF(Adobe Action Message Format)========&g ......
strategyMarketsOfCurrentStrategy.addEventListener(CollectionEvent.COLLECTION_CHANGE, strategyMarketsDataChangedHandler);
strategyMarketsOfCurrentStrategy.removeAll(); &nbs ......