Flash .txt file
- Started
- Last post
- 25 Responses
- tomkat
grrr arrr grr!
Why does flash read my .txt files fine when coming off my testing environment and NOT when coming off a web server?
it kills the line heights and scrambles the text together..
i thought it was a pc/unix problem, but that does not seem to fix it.
- rasko40
I've been having a nightmare using simpletext to write these text files, its like some times just by actually typing a list in simpletext it works ok, puts in the line breaks automatically and all is cool, then I have to make a change, so I do so and upload... NOW the fucker has decided to miss all the line breaks so I have to start inserting break tags manually... this works but its impossible to look at.. sometimes it works sometimes it doesn't, makes no sense at all.
- Goer_Jr0
.txt worked fine on Flash 4/5, since MX, seems you had to use absolute URL (including http://www...)
You may test with local SWF and uploaded TXT.. not very user friendly, sure
For Mac encoding troubleshooting, you should try PCConverter, an usefull app for unix/pc translations
- smellvetica0
use xml
- rasko40
I have it happening right now, it wont even recognise the html, it just displays the tags in the text box, no line breaks or anything... and yes the text box is set as html
???
- rasko40
so I just copied the txt file, removed the br tags and just typed returns in simple text.. and it works!! yet on a different site yesterday it wouldn't have it at all and I had to put in br tags everywhere... no sense at all.
- tomkat0
yeah i was about to use xml...
i just miss the sense, like rasko
- ********0
yeah use XML- Flash MX is completely stupid with txt files- don't try to figure out why or how because it simply makes no sense- Macromedia droppped the ball on this feature...
- ********0
exactly what smellvetica said. 'USE XML"
- unfittoprint0
a little know bug/issue
it treats newlines differently it the file is on an UNIX/Linux box or a Windows server.
I made this especially for that type of situation:
myVars.onLoad = function(sucess) {
if (sucess) {
myLines = String(this.myText).split("\r\n...
// Linux servers [only '\n' works]
if (myLines .length == 1) {
myLines = String(this.myText).split("\n");
}
} else {
trace("ooops!");
}
};
- ********0
nice code, as usual
- tomkat0
ahhh..
- ********0
or why not just external .as files to hand everything such as the .AS Text Tester module.
- rasko40
interesting, so where do I put that, on the timeline?
what does it do exactly, it says 'ooops' if its a windows server?
I'm pretty sure its a unix server.
- rasko40
because I am an AS retard thats why.
- unfittoprint0
First it tries to pass the text variable myText by construction an array of its paragraphs, myLines.
if myLines array length = 1 (meaning it didn't created any lines) it tries again, using the Linux method (/n only).
you can than create your text using a for loop:
for (i=0; i{myLines.length; i++){
textBox.text += myLines[i] + newline
}
- rasko40
youre pretty good at this shit huh?
:D
- unfittoprint0
my mumma says so.
- rasko40
she tells me the same thing.
*runs from flying AS death script*
- unfittoprint0
brother?
:'-)
- ********0
if you guys E-mail me I will send you some interesting files with .txt and .as