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

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”);
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