# Problem with loading text file!

**URL:** <https://forum.kirupa.com/t/problem-with-loading-text-file/24892>\
**Category:** flash\
**Created:** [July 6, 2003, 8:51pm UTC](https://forum.kirupa.com/t/problem-with-loading-text-file/24892 "2003-07-06T20:51:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![adityagaddam](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@adityagaddam](https://forum.kirupa.com/u/adityagaddam)\
**Post date:** [July 6, 2003, 8:51pm UTC](https://forum.kirupa.com/t/problem-with-loading-text-file/24892/1 "2003-07-06T20:51:48Z")

</div>

oki… I am kinda stumped here… :hangover:

I am using loadVars() to load a text file into a textbox. evrything loads fine except wherever there is a line break, it shows up as two line breaks… :stunned: (the line breaks are in there because I used PHP to record whatever is in a textbox (HTML) into a txt file)…

well any ideas?

-Aditya

---

<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 6, 2003, 9:13pm UTC](https://forum.kirupa.com/t/problem-with-loading-text-file/24892/2 "2003-07-06T21:13:41Z")

</div>

lostinbeta and eg solved that one a while ago…  
[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=10394](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=10394)

---

<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 6, 2003, 11:14pm UTC](https://forum.kirupa.com/t/problem-with-loading-text-file/24892/3 "2003-07-06T23:14:18Z")

</div>

hmm… that is a cool thing but it really doesn’t help me. I still get that empty line when there is just a line break…

My text file is this…

```auto

txt=HAHA
MUHAHA
MUHAHA
MUHAA

```

my code for loading the file is

[AS]  
loadhome = new LoadVars();  
loadhome.load(“home.txt”);  
loadhome.onLoad = function(success){  
if(success){  
trace(this.txt);  
home\_txt.condenseWhite = true;  
home\_txt.text = this.txt;  
}  
}  
[/AS]

the trace function and the textbox both show :

```auto

HAHA

MUHAHA

MUHAHA

MUHAA

```

please help…

thanks,  
Aditya

---

<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 6, 2003, 11:25pm UTC](https://forum.kirupa.com/t/problem-with-loading-text-file/24892/4 "2003-07-06T23:25:59Z")

</div>

I tried htmlText (and turned txt.html = true)

now I dont see anything = (

the textbox is blank…

the trace function still shows the contents of the file in the same manner as before…

-Aditya

* * *

---

<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 6, 2003, 11:38pm UTC](https://forum.kirupa.com/t/problem-with-loading-text-file/24892/5 "2003-07-06T23:38:51Z")

</div>

adityagaddam: Did you see the example in the thread posted above? It clearly shows the way how to do it.

---

<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 6, 2003, 11:40pm UTC](https://forum.kirupa.com/t/problem-with-loading-text-file/24892/6 "2003-07-06T23:40:39Z")

</div>

yeah I did…

I learnt condensewhite only works with html textboxes… so I made it a html textbox… but nowe I cant see anythign…

---

<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 6, 2003, 11:41pm UTC](https://forum.kirupa.com/t/problem-with-loading-text-file/24892/7 "2003-07-06T23:41:36Z")

</div>

Check the textFile of the 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:** [July 6, 2003, 11:59pm UTC](https://forum.kirupa.com/t/problem-with-loading-text-file/24892/8 "2003-07-06T23:59:10Z")

</div>

oki… I figured out what was wrong…

now dont kill me or anything (and I dont know why flash is so anal about this) but I had the “bold” on for the textbox. Now htmlText shows up…

regular text doesn’t have linebreaks but thats oki dokie…

Thanks for your patience…

-Aditya
