Dynamic .txt file with simple HTML formatting?

Ok… I have a dynamic text box. Fonts embedded, using the flash mx scrollbar component, the dynamic text box’s instance name is “scroller”.

The actionscript code I am using is as follows…

loadVarsText = new loadVars();
loadVarsText.load(“news.txt”);
loadVarsText.onLoad = function(success) {
if (success) {
trace(“done loading”);
scroller.html = true;
scroller.htmlText = this.var1;
} else {
trace(“not loaded”);
}
};

And… my news.txt file starts with var1=

Everything loads/works fine UNTIL I try using html tags in my news.txt file. The one I need to use is the <b></b> bold tag and the font color tags. When I put text inbetween the html tags, nothing shows up. Under my Dynamic Text box properties, the button with <> enabling HTML formatting is selected…

absolutely stumped!

thx!

I can’t see anything wrong with your code. Can you post your txt file? I know with color tags, the only way it will work (for me anyhow) is if you use hex, if you don’t, the text will disappear. For instance, instead of:


<font color="LIME"></font>

you need to use this:


<font color="#00FF00"></font>

Maybe that’s it?

my news.txt file is as follows…

var1=This is a test. <b> please bold this text </b>

That pumps out just the “This is a test.” and completely ignores the bold text. I even tried using lowercase <b></b> tags but no diff.

:frowning:

search the forums! your answer is already there!


there guys, i joined the search the forums bandwagon

I just did a search and couldn’t find anything close. Either way, your tags were used in the post, but obviously it worked. All I can say is double check everything, maybe try doing it over.

Prstudio - do you know of a thread to explain this? I couldn’t find one.

*Originally posted by prstudio *
**search the forums! your answer is already there!


there guys, i joined the search the forums bandwagon **

actually I did search, tried out a few things but nothing…

hmmm

Although u embedded the font, Flash doesnt include bold and italic automatically. Thats y bold and italic tags may not work.
To solve dis problem, create an text box using the same font u want, using bold, italic and regular style. Embeed the font.
Just in case u dont know, if you embed the font in one text field, all text fields in the movie can use it.

**Keep in mind dat embedding the bold and italic style will triplicate the file size. So only embed bold and italic if u really need to use them. **

There it is.
=)

Or, I think, you can use system fonts that won’t need embedding like one of my favorites, trebuchet MS, or ariel, or sans fonts. They aren’t as fun, but they’ll work.
:beam:

HTML tags suported by Flash:[AS]<a href=“url”>
<b>
<font [color="#xxxxxx"] [face=“Type Face”] [size=“Type Size”]>
<I>
<p [align=“left”|“right”|“center”]>
<u>[/AS]

there’s a technote about that, claudio. :wink:

http://www.macromedia.com/support/flash/ts/documents/htmltext.htm

Thx Kax =)

Actually i did take dat from the tech note and posted here… i think sometimes ppl are kinda lazy to check the links :beam:

they will… as long as they are interested in solving their problems. :stuck_out_tongue:

Im attaching an example file.
=)