# Arg dynamic tweens as preloaders

**URL:** <https://forum.kirupa.com/t/arg-dynamic-tweens-as-preloaders/189169>\
**Category:** Uncategorized\
**Created:** [May 14, 2006, 7:05pm UTC](https://forum.kirupa.com/t/arg-dynamic-tweens-as-preloaders/189169 "2006-05-14T19:05:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joran420](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joran420/32/2329_2.png) [@joran420](https://forum.kirupa.com/u/joran420)\
**Post date:** [May 14, 2006, 7:05pm UTC](https://forum.kirupa.com/t/arg-dynamic-tweens-as-preloaders/189169/1 "2006-05-14T19:05:28Z")

</div>

I have this code that uses a target box that shrinks down around the button you clicked on in a \_scale tween/normal tween

Loader\_xTween = new mx.transitions.Tween(holder\_mc,"\_x", mx.transitions.easing.None.easeNone, holder\_mc.\_x, target.\_x, 100,false);  
Loader\_yTween = new mx.transitions.Tween(holder\_mc, “\_y”, mx.transitions.easing.None.easeNone, holder\_mc.\_y, target.\_y, 100,false);  
Loader\_xScale = new mx.transitions.Tween(holder\_mc,"\_xscale", mx.transitions.easing.None.easeNone, holder\_mc.\_xscale, 5, 100,false);  
Loader\_yScale = new mx.transitions.Tween(holder\_mc, “\_yscale”, mx.transitions.easing.None.easeNone, holder\_mc.\_yscale, 5, 100,false);

I made each of the tweens 100 frames long (If i just let them play like this it is the correct animation)

but if i put in

Loader\_xTween.stop()  
Loader\_yTween.stop()

and then step through the tweens checking load progress(on a loader component)

and advance the tweens

```auto
function ZoomIn(){
	if(_root.MyLoader.percentLoaded < 100){
		Loader_xTween.setPosition(Math.floor(_root.MyLoade r.percentLoaded))
		Loader_yTween.setPosition(Math.floor(_root.MyLoade r.percentLoaded))
	}else{
		Loader_xTween.setPosition(Math.floor(_root.MyLoade r.percentLoaded))
		Loader_yTween.setPosition(Math.floor(_root.MyLoade r.percentLoaded))
	}
}

```

It advances em through the tween but it totally changes where the tween ends on screen… and instead of ending up where the original tween was told to end it ends up in the middle of the screen

argggg getting frusterated
