FLEX中的垂直选框效果

时间:2012-02-06 12:33:37

标签: actionscript-3 flex flex3 marquee

我想在我的应用程序中显示带有选框效果的TEXT。

选取框效果仅适用于BOX中的文本,应该位于“垂直”中。

请尽快帮助我。

1 个答案:

答案 0 :(得分: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>