things start before variables have been loaded from a text file
Posted on 2002-07-10
I am loading around 1,000 variables from a text file. I am copying a movieclip 1,000 times and assigning the copied movieclips with a variable from the text file.
ie: mc1 varBat = 1
mc2 varBat = 45
mc1000 varBat = 12.5
varbat is taken from the text file.
my problem is flash starts to assign the variables before the text file is loaded (see code below). At the moment I load the text file and then have to click a button to copy the variables to the movieclips. I would like to do this as the movieloads.
var i = 0;
varBatNew = "varbat" + i
newClip = "mc"+i;
duplicateMovieClip ("_parent.mc", newClip, 2000-i);
varSound = _root.mcchart[varBatNew].split(",");
_root.mcChart[newClip]._x = convertE(varSound);
_root.mcChart[newClip]._y = convertN(varSound);
_root.mcChart[newClip].varDepth = varSound;
} while (i<1071);
as you can see from my code my do loop isn't very effective. I know I have 1071 variables. Is there any way I van find out how many variables are stored in the text file as this fingure may change.
Any help greatly appreciated