# Variable and tween problem

**URL:** <https://forum.kirupa.com/t/variable-and-tween-problem/309789>\
**Category:** Uncategorized\
**Created:** [May 25, 2010, 3:07am UTC](https://forum.kirupa.com/t/variable-and-tween-problem/309789 "2010-05-25T03:07:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Numinus](https://avatars.discourse-cdn.com/v4/letter/n/9fc29f/32.png) [@Numinus](https://forum.kirupa.com/u/Numinus)\
**Post date:** [May 25, 2010, 3:07am UTC](https://forum.kirupa.com/t/variable-and-tween-problem/309789/1 "2010-05-25T03:07:55Z")

</div>

below is an example of my code.

! the mc only tweens once. why??? !

the myVar traces correctly on every roll over. but the mc only tweens on the first roll over.

* * *

import mx.transitions.Tween;  
import mx.transitions.easing.\*;

var myVar:Number = (mc.\_x + 35);

button.onRollOver = function(){  
trace (“Roll Over”);  
trace (myVar);  
var mytween:Tween = new Tween (mc, “\_x”, Strong.easeOut, mc.\_x, myVar, 1, true);  
}
