<?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>