Flex 字幕滚动效果 网站公告效果

这篇总结的不错

 

 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
				creationComplete="complete()" >
	<mx:Script>
		<![CDATA[
			private function complete():void
			{
				move_up.xFrom = ca.width - 6;   //加6减6是为了首尾连接更加自然"
				move_up.xTo = 0 - description.width + 6; //加6减6是为了首尾连接更加自然"
				move_up.repeatCount = 0; //循环
				move_up.repeatDelay = 0; //循环间隔时间
				move_up.duration = 7000; //滚动一次的时间,单位毫秒
				move_up.play();
			}
			
			private function move_pause():void
			{
				move_up.pause(); //停止
			}
			
			private function move_resume():void
			{
				move_up.resume(); //从停留位置开始
			}
		]]>
	</mx:Script>
	<mx:Move id="move_up" target="{description}" />
	<mx:Panel width="800" height="200" layout="absolute" title="Affiche"
			  fontSize="13" horizontalCenter="0" verticalCenter="0">
		<mx:Canvas id="ca" width="100%" height="100%" left="0" top="0"
				  horizontalScrollPolicy="off" verticalScrollPolicy="off" mouseOver="move_pause()" mouseOut="move_resume()">
			<mx:Label id="description"  horizontalCenter="0"
					 text="<font color='#ff0000'>1. some text here</font><br><font color='#ff0000'>2. <a href='http://sports.sina.com.cn/nba' target='_blank'>链接到新浪NBA</a></font><br>some text here" verticalCenter="0">
			</mx:Label>
		</mx:Canvas>
	</mx:Panel>
</mx:Application>


这个也不错

 

 

你可能感兴趣的:(Flex,Flex 网站公告,Flex 字幕滚动)