# Scrolling Text with mx.transitions.Tween

**URL:** <https://forum.kirupa.com/t/scrolling-text-with-mx-transitions-tween/211219>\
**Category:** flash\
**Created:** [December 28, 2006, 6:20pm UTC](https://forum.kirupa.com/t/scrolling-text-with-mx-transitions-tween/211219 "2006-12-28T18:20:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ofanged1](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ofanged1/32/3131_2.png) [@ofanged1](https://forum.kirupa.com/u/ofanged1)\
**Post date:** [December 28, 2006, 6:20pm UTC](https://forum.kirupa.com/t/scrolling-text-with-mx-transitions-tween/211219/1 "2006-12-28T18:20:55Z")

</div>

I am creating a horizontal text scroller using the kirupa tutorial here [http://www.kirupa.com/developer/actionscript/tween.htm](http://www.kirupa.com/developer/actionscript/tween.htm) my problem is I want it to scroll in an endless loop, and i’m stuck.  
here’s the code

```auto
import mx.transitions.Tween;
import mx.transitions.easing.*;
loc1 = 708;
loc2 = 60/2;
_root.createEmptyMovieClip("scroll_mc", 0);
with (_root.scroll_mc) {
 moveTo(0, 0);
 lineTo(Stage.width, 0);
 lineTo(Stage.width, Stage.height);
 lineTo(0, Stage.height);
 endFill();
 
 createEmptyMovieClip("scrollMask",3);
 with(scrollMask){
 moveTo(108,21);
 beginFill(0x000088);
 lineTo(708,21);
 lineTo(708,60);
 lineTo(108,60);
 endFill();
 }
 
 createTextField("scrollText",2,loc1,loc2,10,10);
 with(scrollText){
 setMask(_parent.scrollMask);
 autoSize = true;
 textStr = " | ";
 for (var i = 0; i < (_global._data.length - 1); i++) {
 textStr = textStr + _global._id* + ": " + _global._data* + " | ";
 }
 text = textStr;
 }
 
 //create the tween
 var xPosT:Tween = new Tween(scrollText, "_x", Regular.easeOut, loc1, (0-scrollText.textWidth), (scrollText.textWidth * 1), false);
 xPosT.onMotionFinished = function() {
  trace("stopped");
 };
}

```
