# Dynamic text

**URL:** https://forum.kirupa.com/t/dynamic-text/403
**Category:** flash
**Created:** [July 16, 2002, 5:36pm UTC](https://forum.kirupa.com/t/dynamic-text/403 "2002-07-16T17:36:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![TheGSB](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@TheGSB](https://forum.kirupa.com/u/TheGSB)
#### Post date: [July 16, 2002, 5:36pm UTC](https://forum.kirupa.com/t/dynamic-text/403/1 "2002-07-16T17:36:33Z")

</div>

How do you go about making a dynamic text box in Flash load text from an external source like a .txt file?

---

<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: [July 16, 2002, 6:18pm UTC](https://forum.kirupa.com/t/dynamic-text/403/2 "2002-07-16T18:18:49Z")

</div>

make a textbox. Change the variable name whatever you like (for example “textbox” 🙂 )  
Then You put an action on a frame or a movieclip… or whatever

```auto
loadVariables("textfile.txt",0);

```

where “textfile.txt” is the textfile you are trying to get the text from…  
If you put it on a frame then it should be as it is but if you prefer a movieclip then make it

```auto
onClipEvent(load) {
loadVariables("textfile.txt",0);
}

```

And in the textfile you put “textbox=” in front of your text (“textbox” is the textbox’s variable name). So it should be  
textbox=bla bla bla  
…  
May I also suggest to put “?var=num” in the loadVariables action  
like this:

```auto
loadVariables("textfile.txt **?var=num**",0);

```

where “var” is a variable (change it to whatever you like) and  
num is a number " (change it to whatever you like)  
And when you update your text file then you have to change the number or the variable as well. Otherwize the people who visit the site won’t see the updated information.  
note: if you put “?var=num” in there it won’t work on you computer. It brings up an error message but if you upload it to the net everything works fine.  
I hope you got it all right.  
For more information about loadVariables and Loadmovie  
visit the link:  
[http://www.kirupaforum.com/showthread.php?s=&threadid=27](http://www.kirupaforum.com/showthread.php?s=&threadid=27)

---

<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: [July 16, 2002, 6:25pm UTC](https://forum.kirupa.com/t/dynamic-text/403/3 "2002-07-16T18:25:14Z")

</div>

Thanks so much!
