Problem with loading text file!

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

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

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…


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 :


HAHA

MUHAHA

MUHAHA

MUHAA

please help…

thanks,
Aditya

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


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

yeah I did…

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

Check the textFile of the example…

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