# Load .txt file with this code added?

**URL:** https://forum.kirupa.com/t/load-txt-file-with-this-code-added/124307
**Category:** Uncategorized
**Created:** [October 2, 2004, 12:12am UTC](https://forum.kirupa.com/t/load-txt-file-with-this-code-added/124307 "2004-10-02T00:12:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bamski](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@bamski](https://forum.kirupa.com/u/bamski)
#### Post date: [October 2, 2004, 12:12am UTC](https://forum.kirupa.com/t/load-txt-file-with-this-code-added/124307/1 "2004-10-02T00:12:13Z")

</div>

## Question:

I was curious if I could make Flash grab the text to use with the code from an external text file rather than from within the AS provided. I found this script on the Kirupa forums somewhere.

## Here is the code:

//position of text box  
x=50  
y=70  
//MAIN TEXT BOX  
content = “Some filler text for the text box. Some filler text for the text box.Some filler text for the text box.Some filler text for the text box.”;

createTextField(“display\_tf”, 1, x, y, 240, 300);  
display\_tf.wordWrap = true;

from = content.length;

setInterval(spill, 0001);

function spill() {  
if (from\>0) {  
from -= 5;  
to = content.length;  
display\_tf.text = content.substring(from, to);

```
} 

```

}

Thanks in advance to anyone who attempts this !!

From,

bamski
