# Tween reload

**URL:** <https://forum.kirupa.com/t/tween-reload/297196>\
**Category:** Uncategorized\
**Created:** [September 27, 2009, 6:00pm UTC](https://forum.kirupa.com/t/tween-reload/297196 "2009-09-27T18:00:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dvinatea](https://avatars.discourse-cdn.com/v4/letter/d/71c47a/32.png) [@dvinatea](https://forum.kirupa.com/u/dvinatea)\
**Post date:** [September 27, 2009, 6:00pm UTC](https://forum.kirupa.com/t/tween-reload/297196/1 "2009-09-27T18:00:49Z")

</div>

Hi,  
I have an swf (page0) which is called in the main page (index) by pressing a button. Page0 has a tween function. At first, it works correctly, but when I press the button for a second time before the tween has finished, it continues working but it starts again. It duplicates. When I press the button a third time, it works 3 times and so on. I need to reload the tween so it works always the same way. How do I do this?  
Thank you

page 0:  
import mx.transitions.Tween;  
import mx.transitions.easing.\*;

var barTween1 : Tween = new Tween(mca, “\_x”, Elastic.easeInOut, 0, 130, 2, true);  
barTween1.onMotionFinished = function() {  
var barTween2:Tween = new Tween(mca, “\_x”, Elastic.easeIn, 130, 260, 2, true);  
barTween2.onMotionFinished = function() {  
var barTween3:Tween = new Tween(mca, “\_x”, Elastic.easeIn, 260, 390, 2, true);  
}  
}
