flex4之实现字幕滚动

<?xml version="1.0" encoding="utf-8"?> 

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"

creationComplete="init()" layout="absolute"> 

<mx:Script>

<![CDATA[

import mx.controls.Alert;

//滚动条字幕

[SWF(width="800", height="600", frameRate="25", backgroundColor="#FFFFFF")]

private function init():void

{

move_up.xFrom=this.width - 6;

move_up.xTo=0 - moveText.width + 6;

move_up.repeatCount=0; //循环次数 0为不限

move_up.repeatDelay=0; //循环间隔时间 

move_up.duration=20000; //滚动一次所需要的时间 

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="{moveText}"/>

<mx:Text id="moveText" width="656" color="#3B3939" fontSize="13" horizontalCenter="-54"

mouseOut="move_resume()" mouseOver="move_pause()"

text="1: 广汽本田4S店奖励      2: 沃尔沃          4S店奖励        3:上海大众第二季消费者促销" textAlign="left"

verticalCenter="-149">

</mx:Text>

</mx:Application>

posted on 2012-02-25 08:24  唐朝  阅读(1786)  评论(0编辑  收藏  举报