Weird inexplicable Flash text behavior. Help!


i've been searching high , low answer , first time i've posted flash forum i've got far.

i've been building few sites in flash rely heavily on loading plain text files swf file (for purpose of quick , easy text updating) using commonly used loadvars script (see end of post example script).
and works absolutely fine - weird starts happening after i've re-edited text file , uploaded it.

here example text content using 'news' load variable in text file.

news=
testing. testing.
123.
testing.
it works!

normally should appear in flash movie when using script can see below:

testing. testing.
123.
testing.
it works!

right?
yes! , indeed does.
except, why @ stage after i've edited , re-saved/uploaded text file lets example to:

news=
testing. testing. testing.
1234.
testing.
please work!


...do this?


testing. testing. testing.

1234.

testing.

please work!


extra blank lines appear in between lines of text - if invisible br tags added.
there no difference in nature of text file - bit of text editing. if go original text - still blank lines - unless upload copy of original (untarnished) text file. inexplicable behavior not predictable - might many times i've edited , uploaded text file before start seeing - , i've used different 3 or 4 different text editors - online browser based text editors such found in net2ftp.com.
in addition - see behavior in browser when viewing site online, when viewing site offline locally, these blank lines never appear!
what's going on?!

any helpful info appreciated.

igor.


here example script contained in flash file loads text file.


var features_lv:loadvars = new loadvars();
features_lv.onload = ontext;
features_lv.load("news.txt");
function ontext(success:boolean) {
if (success) {
news_txt.htmltext = features_lv.news;
} else {
news_txt.text = "unable load text file";
}
}
var mycss = new textfield.stylesheet();
mycss.load("mystyle.css");
mycss.onload = function() {
news_txt.stylesheet = mycss;
textloader();
};



(the css file contains link behaviors.)
quote:

text

i've run kind of thing myself in past. seemed revolve around text editors place return after line, place linebreak, , place both.

additionally seem place 1 or other don't recognize other 1 , if file has adds 1 rather see.

and of course flash recognizes both \r , \n (return , newline) "newline."

i don't know tell fixing it. first recommend use text editor saves utf-8 format. flash seems have less problems format others. can through , remove \r , \n characters after loading vars. , in end stopped using loadvars type of thing , instead went xml , using cdata tag.



More discussions in Adobe Animate CC - General


adobe

Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support