在FLEX中利用marquee制作公告板。

查看源码
示例:


代码:

 

<? xml version="1.0" encoding="utf-8" ?>  
< mx:Application  xmlns:mx ="http://www.adobe.com/2006/mxml"  layout ="absolute"   
    creationComplete
="complete()"  viewSourceURL ="srcview/index.html" >  
    
< mx:Script >  
        
<![CDATA[  
            private function complete():void 
            { 
                move_up.yFrom = cs.height - 6;   
                move_up.yTo = 0 - tt.height + 6; 
                move_up.repeatCount = 0; //loop 
                move_up.repeatDelay = 0; //loop time 
                move_up.duration = 6000; //the time of scroll once 
                move_up.play(); 
            } 
            
            private function move_pause():void 
            { 
                move_up.pause();  //pause 
            } 
            
            private function move_resume():void 
            { 
                move_up.resume(); //start from the pause position 
            } 
        
]]>  
    
</ mx:Script >  
    
< mx:Move  id ="move_up"  target =" {tt} "   />  
    
< mx:Panel  width ="250"  height ="200"  layout ="absolute"  title ="Anouncement"   
        fontSize
="13"  horizontalCenter ="0"  verticalCenter ="0" >  
        
< mx:Canvas  id ="cs"  width ="100%"  height ="100%"  left ="0"  top ="0"   
            verticalScrollPolicy
="off"  mouseOver ="move_pause()"  mouseOut ="move_resume()" >  
            
< mx:Text  id ="tt"  width ="94%"  horizontalCenter ="0"  
                text
="Ntt.cc was created br Minidxer in January of 2008 as a site dedicated to the prolification of Macromedia/Adobe Flex and JavaScript/Ajax."  verticalCenter ="0" >  
            
</ mx:Text >  
        
</ mx:Canvas >  
    
</ mx:Panel >  
</ mx:Application >

你可能感兴趣的:(Flex)