# Loading Text

**URL:** <https://forum.kirupa.com/t/loading-text/1723>\
**Category:** flash\
**Created:** [June 4, 2002, 7:26pm UTC](https://forum.kirupa.com/t/loading-text/1723 "2002-06-04T19:26:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 4, 2002, 7:26pm UTC](https://forum.kirupa.com/t/loading-text/1723/1 "2002-06-04T19:26:21Z")

</div>

Ok, here’s the code:

loadVarsText = new loadVars();  
loadVarsText.load(“[http://www10.brinkster.com/jubbaorf/requiem/flashtest/text.txt](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](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]  
}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 4, 2002, 10:26pm UTC](https://forum.kirupa.com/t/loading-text/1723/2 "2002-06-04T22:26:08Z")

</div>

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]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 4, 2002, 10:27pm UTC](https://forum.kirupa.com/t/loading-text/1723/3 "2002-06-04T22:27:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 4, 2002, 10:28pm UTC](https://forum.kirupa.com/t/loading-text/1723/4 "2002-06-04T22:28:58Z")

</div>

So what was it ?

pom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 4, 2002, 10:37pm UTC](https://forum.kirupa.com/t/loading-text/1723/5 "2002-06-04T22:37:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 5, 2002, 3:39pm UTC](https://forum.kirupa.com/t/loading-text/1723/6 "2002-06-05T15:39:06Z")

</div>

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

pom 0]
