# Load text file

**URL:** <https://forum.kirupa.com/t/load-text-file/9830>\
**Category:** Uncategorized\
**Created:** [December 19, 2002, 7:30am UTC](https://forum.kirupa.com/t/load-text-file/9830 "2002-12-19T07:30:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![toh](https://avatars.discourse-cdn.com/v4/letter/t/f6c823/32.png) [@toh](https://forum.kirupa.com/u/toh)\
**Post date:** [December 19, 2002, 7:30am UTC](https://forum.kirupa.com/t/load-text-file/9830/1 "2002-12-19T07:30:09Z")

</div>

i load external text file using below code:

on (release) {  
loadText = new loadVars();  
loadText.load(“certain.txt”);  
loadText.onLoad = function() {  
scroller.text = this.certaintext;  
};  
}

and there is 5 button, each button load different external text file.  
now, my question is i want a preloader show up when i click the button.(in case the file size is big). i am not asking on how to do a preloader, but where should i put the preloader?

and, can we make the text inside the text file linkable? what i think is cannot, but i want to make sure from you guys.

Hope somebody help. THANX!

---

<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:** [December 19, 2002, 8:15am UTC](https://forum.kirupa.com/t/load-text-file/9830/2 "2002-12-19T08:15:24Z")

</div>

> \*Originally posted by toh \*  
> \*\*and there is 5 button, each button load different external text file.  
> now, my question is i want a preloader show up when i click the button.(in case the file size is big). i am not asking on how to do a preloader, but where should i put the preloader? \*\*

onLoad does the job of preloading.

> \*Originally posted by toh \*  
> **can we make the text inside the text file linkable? what i think is cannot, but i want to make sure from you guys.**

Sure, Insert the script below into your Flash Movie:

```php
myLoadVars = new LoadVars();
myLoadVars.onLoad = function() {
	myTextBox.html = true;
	myTextBox.htmlText = this.LinkToKirupa;
};
myLoadVars.load("textfile.txt");

```

And this into your textfile:

```php
LinkToKirupa=<a href="http://www.kirupaforum.com">Kirupa Forum</a>

```

h88 8]

---

<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:** [December 19, 2002, 8:19am UTC](https://forum.kirupa.com/t/load-text-file/9830/3 "2002-12-19T08:19:25Z")

</div>

Example:

---

<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:** [December 19, 2002, 9:47am UTC](https://forum.kirupa.com/t/load-text-file/9830/4 "2002-12-19T09:47:09Z")

</div>

really thanx h88 for solving this question.  
but, how about the preloader. just like the [bit-101.com](http://bit-101.com), where when you click on the button, a preloader say LOADING xxx.txt before the text show up.

and according to the author of bit-101, the navigation is loaded from XML. how to do that? can someone show me, or where to find such kind of tutorial?

Thanks again,h88!

---

<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:** [December 19, 2002, 10:05am UTC](https://forum.kirupa.com/t/load-text-file/9830/5 "2002-12-19T10:05:45Z")

</div>

sorry to bother again.  
the code you use will make the whole textbox become a link.  
so, if my text file is :

“Go to Kirupa Forum and learn. Kirupa Forum is a great forum.”

and i just want to make the First Kirupa Forum linkable. How i gonna do this?

---

<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:** [December 19, 2002, 10:08am UTC](https://forum.kirupa.com/t/load-text-file/9830/6 "2002-12-19T10:08:24Z")

</div>

Oh well.

---

<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:** [December 19, 2002, 10:34am UTC](https://forum.kirupa.com/t/load-text-file/9830/7 "2002-12-19T10:34:03Z")

</div>

> \*Originally posted by toh \*  
> \*\*really thanx h88 for solving this question.  
> but, how about the preloader. just like the [bit-101.com](http://bit-101.com), where when you click on the button, a preloader say LOADING xxx.txt before the text show up. \*\*

Well, You can do something like:

```php
myTextBox.text = "Loading textfile.txt";
myLoadVars = new LoadVars();
myLoadVars.onLoad = function() {
    myTextBox.html = true;
    myTextBox.htmlText = this.LinkToKirupa;
};
myLoadVars.load("textfile.txt");

```

---

<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:** [December 19, 2002, 10:34am UTC](https://forum.kirupa.com/t/load-text-file/9830/8 "2002-12-19T10:34:34Z")

</div>

well, dont’t know what to say except THANX, h88!!  
and i never thought that the code is so easy:P

so, anyone know how to solve the problem in my 2nd post?

Thank again, h88:P

---

<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:** [December 19, 2002, 10:54am UTC](https://forum.kirupa.com/t/load-text-file/9830/9 "2002-12-19T10:54:31Z")

</div>

what code should i use so that the “loading text.txt” will locate at the center of the textbox?

---

<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:** [December 19, 2002, 1:16pm UTC](https://forum.kirupa.com/t/load-text-file/9830/10 "2002-12-19T13:16:01Z")

</div>

Hey,  
did you figure this out yet?? cause there is a simple solution to this…

onEnterFrame = function(){  
if(!myLoadVars.loaded){  
msgTextBox = “loading”  
}else{  
msgTextBox = “done” // or u can make it nothing  
}  
}
