# Tweener looping problem

**URL:** <https://forum.kirupa.com/t/tweener-looping-problem/256936>\
**Category:** Uncategorized\
**Created:** [April 8, 2008, 11:33pm UTC](https://forum.kirupa.com/t/tweener-looping-problem/256936 "2008-04-08T23:33:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julie2008](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@Julie2008](https://forum.kirupa.com/u/Julie2008)\
**Post date:** [April 8, 2008, 11:33pm UTC](https://forum.kirupa.com/t/tweener-looping-problem/256936/1 "2008-04-08T23:33:41Z")

</div>

[COLOR=black][FONT=Arial]I’ve made a ticker that loads the text into a dynamic text box and all i want it to do is tween from right to left (distant based on textbox size) and then repeat. I have everything working except I don’t know how to make it repeat. I think there’s a looping porperty but not sure how to use it. I think it’s something to do with the fact that it’s inside a load function but I can’t seem to get the textbox size outside that function. Someone please help I’m sure it easy when u know how.[/FONT][/COLOR]  
[COLOR=black][FONT=Arial] [/FONT][/COLOR]  
[COLOR=black][FONT=Arial]This is my code:[/FONT][/COLOR]  
[COLOR=black][FONT=Arial] [/FONT][/COLOR]  
[COLOR=black][FONT=Arial]var URL = “www…”;  
ticker = new LoadVars();  
ticker.onLoad = function(success) {  
if (success) {  
var text = this.text;[/FONT][/COLOR]  
[COLOR=black][FONT=Arial] [/FONT][/COLOR]  
[COLOR=black][FONT=Arial]//inputs text and resize the textfield so it fix[/FONT][/COLOR]  
[COLOR=black][FONT=Arial] \_root.bar\_mc.TickerMC.TickerTextMC.ticker\_txt.text = this.text;  
\_root.bar\_mc.TickerMC.TickerTextMC.ticker\_txt.autoSize = true;

[/FONT][/COLOR]  
[COLOR=black][FONT=Arial] //find out how wide the textbox is and move it that fair past the endpoint  
var textBoxW = \_root.bar\_mc.TickerMC.TickerTextMC.ticker\_txt.textWidth; [/FONT][/COLOR]  
[COLOR=black][FONT=Arial]\_global.textEnd\_x = Number((286.1+textBoxW)\*-1); [/FONT][/COLOR]  
[COLOR=black][FONT=Arial] [/FONT][/COLOR]  
[COLOR=black][FONT=Arial]//move text from right to left and then place text back to the start point.  
Tweener.addTween(\_root.bar\_mc.TickerMC.TickerTextMC,{\_x:textEnd\_x, time:2, delay:2, transition:“linear”, onComplete:function () {  
\_root.bar\_mc.TickerMC.TickerTextMC.\_x=215;}  
});  
} else trace(“Ticker Error loading data”);  
};[/FONT][/COLOR]  
[COLOR=black][FONT=Arial]ticker.load(URL);[/FONT][/COLOR]
