# loadClip\>onLoadComplete\>Tween problem

**URL:** <https://forum.kirupa.com/t/loadclip-onloadcomplete-tween-problem/243341>\
**Category:** flash\
**Created:** [November 5, 2007, 11:32pm UTC](https://forum.kirupa.com/t/loadclip-onloadcomplete-tween-problem/243341 "2007-11-05T23:32:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Randoff](https://avatars.discourse-cdn.com/v4/letter/r/8dc957/32.png) [@Randoff](https://forum.kirupa.com/u/Randoff)\
**Post date:** [November 5, 2007, 11:32pm UTC](https://forum.kirupa.com/t/loadclip-onloadcomplete-tween-problem/243341/1 "2007-11-05T23:32:07Z")

</div>

Hey Guys and Gals-  
I have a strange problem that has been bugging me and can figure it out.

Here is a sample of the code:

> import mx.transitions.Tween;  
> import mx.transitions.easing.\*;  
> var loadListener:Object = new Object();  
> loadListener.onLoadComplete = function(target\_mc:MovieClip, httpStatus:Number):Void {  
> trace(“\>\> loadListener.onLoadComplete()”);  
> trace(“\>\> =============================”);  
> trace(“\>\> target\_mc.\_width: “+target\_mc.\_width);  
> trace(”\>\> httpStatus: “+httpStatus);  
> trace(“LOCATION: “+target\_mc);  
> };  
> loadListener.onLoadInit = function(target\_mc:MovieClip):Void {  
> trace(”\>\> loadListener.onLoadInit()”);  
> trace(”\>\> =============================”);  
> trace("\>\> target\_mc.\_width: "+target\_mc.\_width);

};  
var logoLoader:MovieClipLoader = new MovieClipLoader();  
logoLoader.addListener(loadListener);  
//  
var aItemName:Array = [“What”, “When”, “Where”];  
var mcVideo:MovieClip;  
var nDepth:Number;  
//  
for (var i:Number = 0; i\<aItemName.length; i++) {  
var speedObj = 1;  
nDepth = 10+i;  
mcVideo = this.attachMovie(“sample\_mc”, “mcVideo”+i, nDepth);  
var swfLoad:MovieClipLoader = new MovieClipLoader();  
swfLoad.loadClip(“…/samples/”+aItemName\*+“.swf”, mcVideo.swf\_mc);  
swfLoad.addListener(loadListener);  
//  
mcVideo.\_xscale = 10;  
mcVideo.\_yscale = 10;  
//  
var mcVideoX:Tween = new Tween(mcVideo, “\_x”, Regular.easeInOut, -500, (i\*70)+50, speedObj, true);  
var mcVideoY:Tween = new Tween(mcVideo, “\_y”, Regular.easeInOut, -500, 370, speedObj, true);  
var mcVideoA:Tween = new Tween(mcVideo, “\_alpha”, Regular.easeInOut, 50, 100, speedObj, true);

}

The problem is that I want to load all the images/swf before the Tween happens. So far I haven’t figured out a way to make it Tween after loading. And yes I did try to put the Tween in the onLoadComplete function. It runs into a problem from the for loop. It wouldn’t be a problem but, with it their is.

Maybe someone can think of a fix 🙂

To many days and lack of sleep I can’t think of any right now.

Thx
