# Load external vari's and create MC's for them

**URL:** <https://forum.kirupa.com/t/load-external-varis-and-create-mcs-for-them/46468>\
**Category:** Uncategorized\
**Created:** [March 24, 2004, 9:55pm UTC](https://forum.kirupa.com/t/load-external-varis-and-create-mcs-for-them/46468 "2004-03-24T21:55:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iroqfox](https://avatars.discourse-cdn.com/v4/letter/i/e68b1a/32.png) [@iroqfox](https://forum.kirupa.com/u/iroqfox)\
**Post date:** [March 24, 2004, 9:55pm UTC](https://forum.kirupa.com/t/load-external-varis-and-create-mcs-for-them/46468/1 "2004-03-24T21:55:31Z")

</div>

Hello. I am trying to load external vari’s (which works fine) and then assign them to a movieclip (works). The problem is in the postitioning of the MC after the vari’s are loaded and the MC is duplicated. Here is the script I created.

////////////// setting position///////////////  
xPos = 100;  
yPos = 100;  
//////////loading vari [myVars] from php file///////////  
myVars = new LoadVars();  
myVars.load(“[http://domainname.com/file.php](http://domainname.com/file.php)”);  
myVars.onLoad = function(success) {  
trace(“waiting for data…”);  
if(success) {  
///// myString outs vary into array [comma is delimiter]//  
myString = myVars.aString;  
i = myString.split(",");  
trace (i.length);  
//////////////loops through i array////////////////////  
for (g=0; g\<5; g++) {  
name = i[g];  
xPos += 40;  
duplicateMovieClip (\_root.moviename, name, g);  
trace (name);  
setProperty (name, \_x, xPos);  
}  
///////////if the load doesn’t work///////////////////  
} else {  
trace (“no returned data”);  
}  
}

The MC’s position themselves on top each other. The loop and duplicate script works when its not in the if (success) condition. How can I control positioning in the above script. If someone can help at all it would be greatly appreciated. Pleeezzzz
