# Unload text

**URL:** <https://forum.kirupa.com/t/unload-text/22043>\
**Category:** Uncategorized\
**Created:** [May 29, 2003, 2:03pm UTC](https://forum.kirupa.com/t/unload-text/22043 "2003-05-29T14:03:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jorgmaijen](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@jorgmaijen](https://forum.kirupa.com/u/jorgmaijen)\
**Post date:** [May 29, 2003, 2:03pm UTC](https://forum.kirupa.com/t/unload-text/22043/1 "2003-05-29T14:03:43Z")

</div>

Hej hej!  
I want to load external txt files into my movie. I used this code:

loadText = new loadVars();  
loadText.load(“test.txt”);  
//creating the loadVarsText function  
loadText.onLoad = function() {  
scroller.text = this.testtext;  
}

This worked perfect. The only problem i have is that i want to upload different txt files. When another txt file is uploaded the first one has to be “unloaded”.

Can someone explain how i do that.

---

<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:** [May 29, 2003, 2:20pm UTC](https://forum.kirupa.com/t/unload-text/22043/2 "2003-05-29T14:20:42Z")

</div>

```auto
scroller.variable = scVar
loadText = new loadVars();

// to load in the first file:
loadText.onLoad = function() {
scVar = this.testtext;
}
loadText.load("test.txt");

// to reload a different file:
loadText.onLoad = function() {
scVar = this.anotherfilestext;
}
loadText.load("anotherfile.txt");

```
