# Tween Function Gets Stuck!

**URL:** <https://forum.kirupa.com/t/tween-function-gets-stuck/265404>\
**Category:** flash\
**Created:** [July 8, 2008, 4:33pm UTC](https://forum.kirupa.com/t/tween-function-gets-stuck/265404 "2008-07-08T16:33:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![I3rendan](https://avatars.discourse-cdn.com/v4/letter/i/a9adbd/32.png) [@I3rendan](https://forum.kirupa.com/u/I3rendan)\
**Post date:** [July 8, 2008, 4:33pm UTC](https://forum.kirupa.com/t/tween-function-gets-stuck/265404/1 "2008-07-08T16:33:34Z")

</div>

I have a basic tween setup to move a block of textfields, buttons, and the background image to move off the screen when a button is pressed and every now and then (about 90% of the time) the tween gets stuck in the middle of the motion.

Here’s the code, if anyone can help I’d really appreciate it!

import fl.transitions.Tween;  
import fl.transitions.easing._;  
import fl.controls._;

searchBtn.addEventListener(MouseEvent.MOUSE\_DOWN, moveBounce);

function moveBounce(event:MouseEvent) {

```
var firstTitle_tween:Tween = new Tween(firstTitle, "x", Strong.easeOut, 125, -177, 2, true);
var firstBg_tween:Tween = new Tween(firstBg, "x", Strong.easeOut, 21, -177, 2, true);
var fname_tween:Tween = new Tween(fname, "x", Strong.easeOut, 105, -177, 2, true);
var lname_tween:Tween = new Tween(lname, "x", Strong.easeOut, 105, -177, 2, true);
var orgname_tween:Tween = new Tween(orgname, "x", Strong.easeOut, 105, -177, 2, true);
var city_tween:Tween = new Tween(city, "x", Strong.easeOut, 105, -177, 2, true);
var state_tween:Tween = new Tween(stateabrv, "x", Strong.easeOut, 105, -177, 2, true);
var zip_tween:Tween = new Tween(zip, "x", Strong.easeOut, 105, -177, 2, true);
var searchBtn_tween:Tween = new Tween(searchBtn, "x", Strong.easeOut, 105, -177, 2, true);
var clearBtn_tween:Tween = new Tween(clearBtn, "x", Strong.easeOut, 105, -177, 2, true);
var fnameLbl_tween:Tween = new Tween(fname_lbl, "x", Strong.easeOut, 0, -177, 2, true);
var lnameLbl_tween:Tween = new Tween(lname_lbl, "x", Strong.easeOut, 0, -177, 2, true);
var orgnameLbl_tween:Tween = new Tween(orgname_lbl, "x", Strong.easeOut, 0, -177, 2, true);
var cityLbl_tween:Tween = new Tween(city_lbl, "x", Strong.easeOut, 0, -177, 2, true);
var stateLbl_tween:Tween = new Tween(state_lbl, "x", Strong.easeOut, 0, -177, 2, true);
var zipLbl_tween:Tween = new Tween(zip_lbl, "x", Strong.easeOut, 0, -177, 2, true);

```

}

---

<div class="post-metadata">

**Author:** ![I3rendan](https://avatars.discourse-cdn.com/v4/letter/i/a9adbd/32.png) [@I3rendan](https://forum.kirupa.com/u/I3rendan)\
**Post date:** [July 8, 2008, 8:31pm UTC](https://forum.kirupa.com/t/tween-function-gets-stuck/265404/2 "2008-07-08T20:31:02Z")

</div>

Nevermind, I figured it out… you have to be sure to declare the tween variables in the main class of the AS file. Cool.
