Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Flex or JS Event Flow


Flex EventºÍJS EventÒ»Ñù£¬¶¼´æÔÚÒ»¸öʼþÁ÷£¬Õâ¸öʼþÁ÷³£³£»áµ¼ÖÂһЩÌäЦ½Ô·ÇµÄBugÒÔ¼°´íÎó£» 
Event Flow
l  Capturing:
ʼþ²¶»ñ½×¶Î£¬Èç¹ûÒ»¸ö°´Å¥B1·ÅÔÚÒ»¸öPanel P1ÈÝÆ÷µ±ÖУ¬µ±ÎÒÃǽ²P1×¢²áµã»÷ʼþEP£¬½«B1×¢²áµã»÷ʼþEB,Panel p1µÄ¸¸ÈÝÆ÷ΪApplication app£»
                                    
              b1.addEventListener(MouseEvent.CLICK,e1);
p1.addEventListener(MouseEvent.CLICK,e2);
app.addEventListener(MouseEvent.CLICK,e3);
 
´Ëʱ£¬µ±ÎÒÃǵã»÷B1µÄʱºò£¬·¢ÏÖEPͬʱҲ»áµÃµ½³ö·¢£»
´ÓRootÔªËص½µã»÷µÄÔªËØ£¬ÖмäµÄËùÓÐb1->parentËù×¢²áµÄͬÀàʱ¼ä¶¼»á´¥·¢£¬ÕâÖÖ´Ó¸ùµ½Êó±êʵ¼Êµã»÷µÄÄ¿±êÔªËصĹý³Ì½Ð×öʼþµÄ²¶»ñ£»
 
App-----àp1----------
 
l  Targeting
Ä¿±ê½×¶Î£º´Ëʱµ±¾­ÀúÁËcapturing½×¶ÎÒÔºó£¬Ê¼þÁ÷Á÷¾­Êó±êÖ±½Óµã»÷µÄÄ¿±êÔªËØ£¬´ËʱĿ±êÔªËØÉϼàÌýµÄʼþ¼àÌýÆ÷±»´¥·¢£¬´Ëʱ±íÏÖΪEB±»´¥·¢£»
 
l  Bubbing£º
ðÅݽ׶Σº¹ËÃû˼Ò壬´Ëʱ£¬Ê¼þÁ÷¾­¹ýÒ»´Îµü´úÁ÷¾­ÁËÄ¿±êÔªËØDOMÊ÷ÉÏËùÓнڵãÒԺ󣬿ªÊ¼ÒÔðÅݵÄÐÎÊÆ£¬Íù»ØÁ÷¾­ËùÓеÄÔªËØ£»´ËʱµÄ¹ý³ÌÓ벶»ñ½×¶ÎÕýºÃÏà·´£»
 
b1.addEventListener(MouseEvent.CLICK,e1);
p1.addEventListener(MouseEvent.CLICK,e2);
app.addEventListener(MouseEvent.CLICK,e3);
 
    µÄÕý³£Ë³Ðò·Ö±ðÊÇ´¥·¢ e1(Ä¿±ê½×¶Î)--àe2(ðÅݽ׶Î)---àe3(ðÅݽ׶Î)
 
b1.addEventListener(MouseEvent.CLICK,e1);
p1.addEventListener(MouseEvent.CLICK,e2,true);
app.addEventListener(MouseEvent.CLICK,e3,true);
    addEventListenerµÄµÚÈý¸ö²ÎÊýΪuse_capture£¬Ä¬ÈÏΪfalse£¬±íʾ´Ëʼþ¼àÌýÆ÷ÔÚ²¶»ñ½×¶Î²»´¥·¢£¬´ËʱÈç¹ûÉèÖÃΪtrue,Ôòʼþ´¥·¢Ë³ÐòΪ:
               e3(²¶»ñ½×¶Î)-àe2(²¶»ñ½×¶Î)àe1(Ä¿±ê½×¶Î)
          


Ïà¹ØÎĵµ£º

flexµ÷ÓÃas2µÄswf

ÓÉÓÚavm°æ±¾µÄÎÊÌ⣬flex3ÎÞ·¨Ö±½Óµ÷ÓÃflash×öµÄswfÎļþ£¬ÅªÁËÒ»Ì죬×îºóÖÕÓÚÏëµ½ÁËÒ»¸ö°ì·¨£¬½«LocalConnectºÍflexµ÷ÓÃas3Á½ÖÖ·½Ê½ÔÜÔÚÁËÒ»Æð£¬ËãÊÇÔÝʱ°ÑÕâ¸öÎÊÌâ½â¾öÁË£¡
´æÆðÀ´£¬Áô×ÅÒÔºóÐÞ¸Ä
µÚÒ»²½£ºÓÃflash×öÒ»¸öas2µÄÎļþ
ÎÒÔÚÀïÃæÌí¼ÓÁËÒ»¸ö°´Å¥
ÔÚµÚһ֡дÏÂÃæµÄ´úÂë
mybtn.onRelease=function()
 {
......

flex {as×ܽá}

  ×÷Ϊһ¸ö²»ÈëÁ÷µÄflex¿ª·¢ÈËÔ±×ܽáһϲ»ÈëÁ÷µÄ¸ÐÎò¡£
  ÎÒÒ»¶¨Òª¼Çס£¬asÖеıäÁ¿µÄ×÷Ó÷¶Î§Ö»ÓÐÁ½ÖÖ£¬functionºÍclass,ËùÒÔÒªÏëÓñհü¾ÍÐèÒªÒ»¸öcreateFunctionµÄ¶«Î÷²ÅÐУ¬²»ÒªÍýÏëÔÚforÑ­»·ÖÐÓñհüÁË¡£¿´ÁËÒ»ÏÂas3µÄ²Î¿¼£¬·¢ÏÖËüµÄÇ°ÊÀºÍlua»¹ÕæÏñ£¬as3µÄ¼Ì³ÐÆäʵ»¹ÊÇprototypeÀ´×öµÄ£¬¾ÍÊÇluaµÄÔª±íÁË£¬ ......

9±¾¾­µäFlex Asµç×ÓÊé


ActionScript 3.0 ÓïÑÔºÍ×é¼þ²Î¿¼

Foundation ActionoScript3.0 ¶¯»­

Learning Flex3

AS3 Cheat Sheets

Flex Frameword Diagram

Rich Internet Applications With Adobe Flex & Java
......

FABridge½Ì³Ì(Flex+Ajax) 2

Ê×ÏÈÔÚfademo.mxmlÖÐÉùÃ÷Ò»¸öbutton£¬²¢Ìí¼ÓÒ»¸öbtnClick·½·¨£º
view plaincopy to clipboardprint?
<?xml version="1.0" encoding="utf-8"?> 
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"   
             ......

FlexÁ½ÖÖµ¯³ö´°¿Ú

1. ×î¼òµ¥µÄ¾¯¸æ´°¿Ú
ÄãÐèÒªÏȵ¼ÈëAlertÀࣺ import mx.controls.Alert;
È»ºóÔÚÏëÒªµ¯³ö¾¯¸æµÄʱºòʹÓãº
Alert.show(“ÄãÈ·¶¨ÒªÍ˳öϵͳÂð?”,“È·ÈÏ”,Alert.YES|Alert.NO,null,logout)
²ÎÊý˵Ã÷£ºµÚÒ»¸ö²ÎÊýÊÇÒªÏÔʾµÄÎı¾£¬µÚ¶þ¸ö²ÎÊýÊÇ´°¿ÚµÄ±êÌ⣬ÕâÁ½¸ö²ÎÊýÊÇ×î¾­³£Óõġ£µÚÈý¸ö²ÎÊýÊÇ°´Å¥£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ