Changeset 151 for trunk

Show
Ignore:
Timestamp:
05/07/08 19:13:31 (7 months ago)
Author:
silver
Message:
 
Location:
trunk/buddypub/bpclientflex/src
Files:
2 modified

Legend:

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

    r150 r151  
    1515        <mx:Script> 
    1616                <![CDATA[ 
     17                        import mx.controls.Alert; 
     18                        import mx.effects.Move; 
    1719                        import org.cnflex.buddypub.mvc.control.EventHandlers; 
    18                         import com.firemoss.modelglue.event.ModelGlueEvent;                      
     20                        import com.firemoss.modelglue.event.ModelGlueEvent; 
     21                         
    1922                ]]> 
    2023        </mx:Script> 
     24         
    2125        <container:Main width="100%" height="100%"/> 
    22         <popup:MessagePopup x="300" y="300"/> 
     26        <mx:Button click="msgBox.addMessage()" label="测试"/> 
     27        <popup:MessagePopup id="msgBox" visible="false" x="{width-msgBox.width-2}" /> 
     28         
    2329</mx:Application> 
  • trunk/buddypub/bpclientflex/src/org/cnflex/buddypub/mvc/view/popup/MessagePopup.mxml

    r150 r151  
    11<?xml version="1.0" encoding="utf-8"?> 
    2 <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="200" height="250" 
     2<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="250" height="150" 
    33        borderColor="#FF690A" themeColor="#FEFFFF" borderStyle="solid"  
    4         backgroundAlpha="1" 
     4        backgroundAlpha="1" visible="{isPlaying}" mouseOver="isMouseOver=true" 
     5         mouseOut="isMouseOver=false"  
    56         backgroundColor="#fff5df" > 
    67         
    78        <mx:Script> 
    89                <![CDATA[ 
     10                        import mx.core.Application; 
     11                        import mx.managers.CursorManager; 
     12                         
     13                        private var isMouseOver:Boolean = false; 
     14                         
     15                        [Bindable] 
     16                        private var isPlaying:Boolean = false; 
     17                         
    918                        [Bindable] 
    1019                        private var msgTitle:String = "提示:"; 
    1120                         
     21                        [Bindable] 
     22                        private var msgContent:String = "内容内容内容内容内容内容!";         
     23                         
     24                        public function addMessage():void{ 
     25                                showMessage();                           
     26                        } 
     27                         
     28                        private function showMessage():void{ 
     29                                                                 
     30                                moveup.yFrom = Application.application.height; 
     31                                moveup.yTo = Application.application.height - height; 
     32                                isPlaying = true; 
     33                                moveup.play();   
     34                        } 
     35                         
     36                        private function displayMessage():void{                          
     37                                setTimeout(hideMessage,2000);                            
     38                        }        
     39                         
     40                        private function doneMessage():void{ 
     41                                //Alert.show("display done!"); 
     42                                isPlaying = false;                                                               
     43                        } 
     44                         
     45                        private function hideMessage():void{ 
     46                                if(isMouseOver){ 
     47                                        setTimeout(hideMessage,1000);                                    
     48                                }else{ 
     49                                        movedown.yFrom = Application.application.height - height; 
     50                                        movedown.yTo = Application.application.height;                                                           
     51                                        movedown.play(); 
     52                                } 
     53                        }                                        
    1254                         
    1355                ]]> 
    1456        </mx:Script>  
     57         
     58        <mx:Move id="moveup" target="{this}" duration="1000" effectEnd="displayMessage()" /> 
     59        <mx:Move id="movedown" target="{this}" duration="1000" effectEnd="doneMessage()"/>  
    1560          
    16           
    17         <mx:HBox width="100%" backgroundColor="#FF680A"> 
    18                 <mx:Label width="100%" paddingLeft="6" text="{msgTitle}" fontSize="14" color="#FFFFFF" /> 
    19         </mx:HBox> 
    20                          
    21         <mx:VBox width="100%" height="100%"> 
    22                  
    23         </mx:VBox> 
     61        <mx:Box width="100%" backgroundColor="#FF680A"> 
     62                <mx:Label width="100%" paddingLeft="6" text="{msgTitle}" fontSize="14" color="#FFFFFF" />        
     63        </mx:Box> 
     64         
     65        <mx:Box width="100%" height="100%" horizontalAlign="center" verticalAlign="middle"> 
     66                <mx:Text text="{msgContent}" fontSize="14"/>     
     67        </mx:Box> 
     68         
    2469         
    2570</mx:Canvas>