<?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" paddingTop="20" paddingBottom="20" paddingRight="0" paddingLeft="0" creationComplete="update()" resize="update()" horizontalScrollPolicy="off" > <mx:Label id="theText" styleName="{textStyleName}" text="{text}"/> <mx:Sequence id="textMove" target="{theText}" repeatCount="0"> <mx:Pause id="pause1" duration="{pauseDuration}"/> <mx:Move id="move1" duration="{((theText.width-width)/scrollSpeed) * 1000}" xFrom="0" xTo="{0-(theText.width-width)}" easingFunction="{mx.effects.easing.Linear.easeNone}"/> <mx:Pause id="pause2" duration="{pauseDuration}"/> <mx:Move id="move2" duration="{((theText.width-width)/scrollSpeed) * 1000}" xFrom="{0-(theText.width-width)}" xTo="0"/> </mx:Sequence> <mx:Script> <![CDATA[ import mx.effects.easing.Linear; import mx.effects.Move; [Bindable] public var text:String; [Bindable] public var pauseDuration:int = 0; [Bindable] public var textStyleName:Object; [Bindable] public var scrollSpeed:int = 20; public function update():void { validateNow(); textMove.end(); if(theText.width > width) { textMove.play(); } } ]]> </mx:Script> </mx:Canvas>