Changeset 152

Show
Ignore:
Timestamp:
05/07/08 23:07:43 (8 months ago)
Author:
silver
Message:
 
Location:
trunk/buddypub/bpclientflex/src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/buddypub/bpclientflex/src/index.mxml

    r151 r152  
    2020                        import com.firemoss.modelglue.event.ModelGlueEvent; 
    2121                         
     22                        private function testAlert():void{ 
     23                                var event:ModelGlueEvent = new ModelGlueEvent(EventHandlers.ALERT_MESSAGE,{message:"This is a test message"}); 
     24                                event.dispatch();                        
     25                        } 
     26                         
    2227                ]]> 
    2328        </mx:Script> 
    2429         
    2530        <container:Main width="100%" height="100%"/> 
    26         <mx:Button click="msgBox.addMessage()" label="测试"/> 
     31        <mx:Button click="testAlert()" label="测试"/> 
    2732        <popup:MessagePopup id="msgBox" visible="false" x="{width-msgBox.width-2}" /> 
    2833         
  • trunk/buddypub/bpclientflex/src/org/cnflex/buddypub/mvc/control/EventHandlers.as

    r135 r152  
    2121                public static const RPC_FAULT:String = "RPC_FAULT"; 
    2222                public static const INTERNAL_FAULT:String = "INTERNAL_FAULT"; 
     23                public static const ALERT_MESSAGE:String = "ALERT_MESSAGE"; 
    2324                                 
    2425                public static const USER_LOGIN:String = "USER_LOGIN";                            
  • trunk/buddypub/bpclientflex/src/org/cnflex/buddypub/mvc/view/popup/MessagePopup.mxml

    r151 r152  
    33        borderColor="#FF690A" themeColor="#FEFFFF" borderStyle="solid"  
    44        backgroundAlpha="1" visible="{isPlaying}" mouseOver="isMouseOver=true" 
    5          mouseOut="isMouseOver=false"  
     5         mouseOut="isMouseOver=false" creationComplete="init()"  
    66         backgroundColor="#fff5df" > 
    77         
    88        <mx:Script> 
    99                <![CDATA[ 
     10                        import org.cnflex.buddypub.mvc.control.EventHandlers; 
     11                        import com.firemoss.modelglue.ModelGlueFramework; 
     12                        import com.firemoss.modelglue.event.ModelGlueEvent; 
     13                        import mx.collections.ArrayCollection; 
    1014                        import mx.core.Application; 
    1115                        import mx.managers.CursorManager; 
     
    2024                         
    2125                        [Bindable] 
    22                         private var msgContent:String = "内容内容内容内容内容内容!";         
     26                        private var msgContent:String = "";      
    2327                         
    24                         public function addMessage():void{ 
    25                                 showMessage();                           
     28                        private var queueMessages:ArrayCollection = new ArrayCollection(); 
     29                         
     30                        private function init():void{                            
     31                                ModelGlueFramework.subscribe(EventHandlers.ALERT_MESSAGE,this,addMessage);                       
     32                        } 
     33                         
     34                        public function addMessage(event:ModelGlueEvent):void{ 
     35                                if(isPlaying){ 
     36                                         
     37                                }else{ 
     38                                        showMessage(); 
     39                                }                                
    2640                        } 
    2741