# Tweening With Variables

**URL:** <https://forum.kirupa.com/t/tweening-with-variables/269202>\
**Category:** flash\
**Created:** [August 24, 2008, 2:50pm UTC](https://forum.kirupa.com/t/tweening-with-variables/269202 "2008-08-24T14:50:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stupidsaint](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@stupidsaint](https://forum.kirupa.com/u/stupidsaint)\
**Post date:** [August 24, 2008, 2:50pm UTC](https://forum.kirupa.com/t/tweening-with-variables/269202/1 "2008-08-24T14:50:57Z")

</div>

I am making a small slideshow of images using externally loaded pictures and moving them with actionscript

```auto

 var tweenPart1:Tween = new Tween(eval("_root."+_global.ticker), "_x", Strong.easeOut, _global.startPoint, _global.centreStage, _global.speed, true);
 var textAlphaPart1:Tween = new Tween(_root.textItems, "_alpha", Strong.easeOut, 0, 100, _global.speed, true);
 
 var tweenPart2:Tween = new Tween(eval("_root."+_global.ticker), "_x", Strong.easeIn, _global.centreStage, (-_global.startPoint), _global.speed, true);
 var textAlphaPart2:Tween = new Tween(_root.textAlpha, "_alpha", Strong.easeIn, 0, 100, _global.speed, true);
 

```

as you can see the target for moving the image is a variable. the only problem with this is that if you want to use this script, it cannot be in a loop script like onEnterFrame or onClipEvent(enterFrame) becase it will run thought it continousley and will keep resetting the tween. if you only run though it once the \_global variable will not change and will only tween the same image.

is there any way to make it update after the tween?

thanks,

Stupidsaint
