flex 滚动信息,类似marquee的展现

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
     creationComplete="complete()">
     <mx:Script>
         <![CDATA[
          import mx.controls.Alert;
             private function complete():void
             {
                 move_up.yFrom = cs.height - 6;     //"加6减6是为了首尾连接更加自然"
                 move_up.yTo = 0 - zz.height + 6;   //同上
                 move_up.repeatCount = 0; //无限次重复
                 move_up.repeatDelay = 0; //重复时间,毫秒
                 move_up.duration = 10000; //滚动一次的时间,毫秒
                                
                
                 move_up.play();

             }
           
             private function move_pause():void
             {
                 move_up.pause();   //暂停
             }
           
             private function move_resume():void
             {
                 move_up.resume(); //从暂停位置开始
             }
             private function sendto(flag:String):void{
              Alert.show(flag);
             }
         ]]>
     </mx:Script>
     <mx:Move id="move_up" target="{cs}" />
     <mx:Panel width="250" height="458" layout="absolute" title="公告栏"
         fontSize="13" horizontalCenter="0" verticalCenter="0" verticalScrollPolicy="off" horizontalScrollPolicy="off" mouseOver="move_pause()" mouseOut="move_resume()">
         <mx:VBox id="cs" width="220" height="100%" >
             <mx:Text id="zz" text="zzzzzzzzzzzzz" click="sendto('zz');"/>
             <mx:Text id="ww" text="wwwwwwwwwwwww" click="sendto('ww');"/>
             <mx:Text id="hh" text="hhhhhhhhhhhhh" click="sendto('hh');"/>
         </mx:VBox>
     </mx:Panel>
</mx:Application>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值