2012-02-06 85 views
0

我想在應用程序中顯示帶有選取框效果的TEXT。FLEX中的垂直選取框效果

字幕效果只在BOX中的文字上,並且應該在垂直方向。

請儘快幫我。

+0

請訪問這個[鏈接](http://ntt.cc/2008/04/14/simple-tips-to-realize-the-marquee-effect-in-flex-with-source-code .html) – 2012-02-06 12:34:41

回答

1

這段代碼適合我。

<fx:Script> 
    <![CDATA[ 
     import mx.collections.ArrayCollection; 
     import mx.effects.Move; 

     import spark.events.IndexChangeEvent; 

     // Define a new Zoom effect. 
     private var zMove:Move = new Move(); 

     private function toLeft():void { 
      // Set duration of zoom effect. 
      zMove.duration = 20000; 
      zMove.xFrom = 0.1 ; 
      zMove.xTo = -label2.width; 
      zMove.target = label2; 
     } 

     private function rightToLeft():void { 
      // Set duration of zoom effect. 
      zMove.duration = 20000; 
      zMove.xFrom = Capabilities.screenResolutionX; 
      zMove.xTo = 0.1; 
      zMove.target = label2; 
     } 

     private function zoomeffect():void { 
      if(zMove.xFrom != 0.1) { 
       toLeft(); 
      } else { 
       rightToLeft(); 
      } 
      label2.visible=true; 
      zMove.play([label2],false); 
     } 

    ]]> 
    </fx:Script> 

      <s:Group width="100%" bottom="0" height="50" contentBackgroundColor="#d0382b" > 
     <s:Label id="label2" text="Marquee effect in flex " 
       top="25" height="50" fontSize="15" fontStyle="italic" 
       fontFamily="Verdana" verticalCenter="0" visible="false" 
       creationComplete="moveffect()" effectEnd="moveffect()"/> 
     </s:Group> 
+0

我想創建水平滾動文本Like Marquee在文本重複之間沒有空白間距。 我的問題來了,當我想循環它。我在Adobe Flex中使用了移動功能。但是,它只會在文本完成滾動頁面時纔會循環。我希望它不斷滾動並重覆文本,而不存在空間。 Adobe Flex如何實現?請儘可能儘快回覆 – MageNative 2017-06-08 06:50:23