Loading Text

Ok, here’s the code:

loadVarsText = new loadVars();
loadVarsText.load(“http://www10.brinkster.com/jubbaorf/requiem/flashtest/text.txt”);
nPeople = 12
for(ii = 1; ii<=nPeople;ii++){
_ _ _ _ attachMovie(“buttonClip”, “copy”+ii, ii)
_ _ _ _ this[“copy”+ii]._x = 0
_ _ _ _ this[“copy”+ii]._y = this[“copy”+(ii-1)]._y + (this[“copy”+(ii-1)]._height)
_ _ _ _ this[“copy”+ii].nButton = this[“nPerson”+ii]
_ _ _ _ }

nButton is the variable name of the Text field. This code works when I have nPerson1, nPerson2, etc contained within the frame Actions, however, when I try to load in the text variables…its a noshow…Any help?

I also tried giving the text box the instance name nButton and doing:

this[“copy”+ii].nButton.text = this[“nPerson”+ii]

also had this:

loadVarsText = new loadVars();
loadVarsText.load(“http://www10.brinkster.com/jubbaorf/requiem/flashtest/text.txt”);
loadVarsText.onLoad = function (success){
if (success){
this[“copy”+ii].nButton = this[“nPerson”+ii]
}
}

nPeople = 12
for(ii = 1; ii<=nPeople;ii++){
attachMovie(“buttonClip”, “copy”+ii, ii)
this[“copy”+ii]._x = 0
this[“copy”+ii]._y = this[“copy”+(ii-1)]._y + (this[“copy”+(ii-1)]._height)
this[“copy”+ii].nButton = this[“nPerson”+ii]
}

What did you put in your text file ?
Anyway the second aproach seems to be the good one. You usually have to create a onLoad callback function with loadVars objects, ** and then load the data**.

pom 0]

i tried. Sinf answered me. It works, but not entirely the way i want it. I have to change it around.

So what was it ?

pom 0]

i am still unsure. beacuse he said that my text looked wrong, but it would load straight into a text box, it just wouldn’t load if the text box was in the movieclip. So I really dont know what the answer was. I’m workin on it. when i figure it out, i’ll get back to ya

Thanks. That loadVars object is really strange… Sinf, ever considered making a tutorial about it ?

pom 0]