# Dynamic text

**URL:** https://forum.kirupa.com/t/dynamic-text/22107
**Category:** Uncategorized
**Created:** [May 30, 2003, 10:28am UTC](https://forum.kirupa.com/t/dynamic-text/22107 "2003-05-30T10:28:10Z")
**Posts on this page:** 3
**Page:** 3

<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 7, 2003, 9:02pm UTC](https://forum.kirupa.com/t/dynamic-text/22107/41 "2003-06-07T21:02:15Z")

</div>

try this

make a movie with 3 buttons (1,2 and 3)

for each button you need a .txt file.

now on each button add these actions

[AS]  
on (release) {  
loadText = new loadVars();  
loadText.load(“ **NAME OF YOU TEXT FILE.txt** ”);  
loadText.onLoad = function(success) {  
if (success) {  
// trace(success);  
newsBox.html = true;  
newsBox.htmlText = this.myNews;  
}  
};  
}  
[/AS]

now call your dyanamic text box “newsBox” [no “”]

and that is it, save the .fla, .swf and the 3 different .txt files in the same folder. (very important:) )

here is a winzip file you you to look at

# ============ be warned it is a whole 6kb:smirk:

---

<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 7, 2003, 9:13pm UTC](https://forum.kirupa.com/t/dynamic-text/22107/42 "2003-06-07T21:13:06Z")

</div>

i have just found my fault

in the text files you MUST add

```php
myNews=

```

on the first line

then there it is:trout:

---

<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 7, 2003, 9:16pm UTC](https://forum.kirupa.com/t/dynamic-text/22107/43 "2003-06-07T21:16:08Z")

</div>

let me explain

the code is this

[AS]on (release) {  
loadText = new loadVars();  
loadText.load(“NAME OF YOU TEXT FILE.txt”);  
loadText.onLoad = function(success) {  
if (success) {  
// trace(success);  
newsBox.html = true;  
newsBox.htmlText = this.myNews;  
}  
};  
}  
[/AS]

the part you need is

[AS]newsBox.htmlText = this.myNews;[/AS]

the part that says

[AS]myNews[/AS]

you can change this to anything you want.

this is what you add to the start of the text files

so if you change it to

[AS]newsBox.htmlText = this.chris9902;[/AS]

the start of you text file would start

[AS]chris9902=[/AS]

hope that help

i will wirte a full tutorial when i get some time:)

[Previous page](https://forum.kirupa.com/t/dynamic-text/22107.md?page=2)
