December 18, 2002
Supported HTML Tags

This is a very boring entry, but I want to contribute a little bit to the knowledge out there. I just stumbled by chance over the <LI> bulletpoint tag which looks like it is supported by the htmlText of Flash MX. I say I stumbled, because even when I searched very hard I could not find any references to this new tag, except for one short thread on Flashcoders from February where Bokel announced it. The Macromedia site only mentions the old tags, but it misses the following info:

<LI> //new paragraph with a bullet point
<TEXTFORMAT //textfieldoptions with following attributes
BLOCKINDENT="20" //textdistance from left border
INDENT="50" //textdistance of first line from left
LEADING="12" //lineheight
LEFTMARGIN="50" //distance from left border
RIGHTMARGIN=" //distance from right border
TABSTOPS="40,100,150"> //list of tabstoppositions from left border
//use \t to insert a tabstop into your text


The problem I still have, is that it seems to be impossible to give that bulletpoint a different color than black... Anybody knows how?

Posted at December 18, 2002 07:21 PM | Further reading
Comments

It happens because Flash slightly changes htmlText. You set something with a FONT attribute outside the LI attributes, but if you look at .htmlText after setting it, the FONT attributes will be have bought inside the LI attributes (duplicated for each one). I don't know how to avoid this!

Posted by: Dcoker on December 19, 2002 03:32 AM

I just stumbled across it as well. I've used it in an external text file, and the movie reads all the html formatting except for the closing tag. Everything after the opening list tag is bulleted. Know anything about this? Two months later, and the Macromedia site is still no help.

Posted by: eric on February 20, 2003 10:00 PM


Thanks for the info.

I hope someone can help with this one. I am calling up an external html file with a link using the get method after it. The html does not show up whenever I use the anpresand (&). When I take out the (&) it works. Is Flash MX using the (&) symbol for something else? Is their a way to cancel out it's special purpose? Any info would be helpful! Thanks.


Joe Denver MD


Posted by: mbrubens on February 28, 2003 11:14 PM

here's the code:

HREF="pi.html?email=jekr@whatever.net&plastname=Denver" target="_blank">Joe Denver MD

Posted by: mbrubens on February 28, 2003 11:20 PM

joe denver,

The reason your links are not showing is because the & symbol is used by flash when loading external files to designate the next variable. Similiar to the get method, flash reads variables like this from a text file.

var1=blah1&var2=blah2

in flash var1 and var2 are now set. So if you put an "&" anywhere in blah1 or blah2, flash reads it as a new variable.

The solution is to url encode the "&" in the text file. This is done by replacing all "&" in the text file with "%26". Then in flash you need to use the "unescape" function on the variable to convert the "%26" back to "&" so the links will work.

I have a php script which does this but you can just put this in your text file:

HREF="pi.html?email=jekr@whatever.net%26plastname=Denver" target="_blank"

and this in your flash file

textBoxName.htmlText = unescape(varName);

Posted by: Cade on April 27, 2003 06:13 AM

I want to put an txt file but the format is not the one I write in the txt file...the format is always the one in flash property box
Can you help

Posted by: Filipe Falcão on October 22, 2003 03:12 PM

Has anyone figured out how to give bulletpoints a different color other than black?

Posted by: allen on November 8, 2003 05:08 PM

The only way I see to get a different color for the bulletpoints is to put the whole textfield into a symbol and colorize the symbol. Of course this way you can have only one color for the complete text.

Posted by: Mario Klingemann on November 8, 2003 05:47 PM

Hi,

Anyone had problems with Flash MX cutting characters in a link inside an tag of an texfields html? It looks like functions of a html textfield only send 128 characters to the browser ommiting the rest("http://" plus 128 characters ) Any idea how to fix this? Is someone of macromedia reading this?


Thanks a lot

Diego

Posted by: Diego Pino N on November 19, 2003 01:39 PM

I'm new at this, so here goes.

I'm trying to format a text (named "Benefits) file that flash reads using the loadvariable command loadVariablesNum("Benefits.txt", 0);

The file "Benefits.txt" with a variable name of "news" reads "news=\t a1\t a2\t a3.

I was expecting to see:
a1 a2 a3

No such luck. I'm I missing the point?

Posted by: sunny on December 22, 2003 10:28 PM

this is would br better if you would put the function of the html tags in the introduction!!!

Posted by: 555 on January 16, 2004 04:49 AM

I figured out a way to display colored bullets!

I'm helping a co-worker with some actionscript. He's an web designer, I'm a web developer. He knows flash (design mostly), I code (but don't necessarily know actionscript).

Anyway, we are loading an external file with LoadVar and putting the loaded var into the htmlText property of a dynamic text box. Well it renders the <li> tags black and everything else the text color for the text box (white). So we put a bullet char in place of the <li> tag. This works with color. In the text file we used %E2%80%A2 as the bullet code (this is the 'escaped' value for a bullet char). I found this out by pasting a bullet from charmap (PC) into google and submitting, then looking at the query string in the address bar. If you're not using an external file you could probably put &#8226; right into the code (you can't use & in the text file because that delimits the variables).

Now you say, "Well how do you get the tabs correct?" Thanks to the original post, we used the <TEXTAREA> tag with a blockindent="20" and indent="-8". This goes around the whole list of bulleted items (as <ul> would in HTML). What this does is indents the whole block 20px then every new line (beginning with the bullet char) gets pulled back 8px. Works great. Both on PC and Mac.

Hope this helps!

Posted by: brillohead on January 22, 2004 06:03 PM

Using Flash MX, I have a scrolling text box that is linked to an external TXT file. I have inserted HTML tags in order to format the text. All coding works except for the links to named anchors in external HTML documents. Flash seems to strip away the "#name" part of the URL. Seems simple enough, but I can't get this to work. ANYBODY?

Posted by: Kevin Ash on January 26, 2004 10:34 PM

Thanks 555! It helped alot, exept the %E2%80%A2 as it showed something else in flash, I used bullet character itself by typing it(alt-0149) into text file.
I believe you also used instead of

Posted by: freq on February 10, 2004 02:46 PM

I meant thanks brilliohead! ;p

Posted by: freq on February 10, 2004 02:48 PM

er.. used TEXTFORMAT instead of TEXTAREA

Posted by: freq on February 10, 2004 02:49 PM

thanks 555 it helped alot to!
I needed a numeric list "<ol>", I used your code but with a little improvement (added tabstops):
<TEXTFORMAT BLOCKINDENT="20" INDENT="-18" tabstops="[20]">
<br>1.<tab>bullet 1.....
<br>2.<tab>bullet 2.....
.
.
<br>10.<tab>bullet 10.....
</TEXTFORMAT>
what it does, it assure that the word "bullet" is at 20pixels from left, so if there is line break it will be exacly align with the others lines.

Math.
Montreal Qc.

Posted by: The_optimizer on February 26, 2004 07:12 PM

Doh!! new here!
sorry 555 but it was intended to brillohead

Posted by: The_optimizer on February 26, 2004 07:15 PM

@The_optimizer:

Hm, your code does not assure that the tenth "bullet" appears aligned with number 1 to 9, or does it? In my test movie it does not, but maybe I miss something here...

Would be glad to hear from someone who can clarify this for me.

PS: My text file looks like the following:
&text=not indented (correctly). Now (partial) indentation starts:[TEXTFORMAT BLOCKINDENT="20" INDENT="-18" tabstops="20"][br]1. [tab]bullet 1[br ]2. [tab]bullet 2[br]10.[tab]bullet 10[/TEXTFORMAT]&

I had to enter brackets around the tags here to make them show...

Posted by: Kryz on May 18, 2004 11:45 PM

Hi guys,
Dim newbie web designer here.

I have some code which allows me to resize some text in a dynamic text/scrollbar field in Flash. The text is being pulled from an external .txt file called homepage.txt which is formatted with HTML tabs. Everything works fine - except when the client resizes the text - the external file's HTML formatting is overwritten. Thus I crucially lose my red link colours to external URL's. Can anyone help me with a solution so that I can retain font colours on my links?

Here is the code.

loadText = new loadVars();
loadText.load("homepage.txt");
// creating the loadVarsText function
loadText.onLoad = function() {
scroller.html = true;
scroller.htmlText = this.homepage;
};
// point size of the smallest text option
smallestSize = 10;
// difference in points between the text sizes
difference = 1;
// number of text size options. 3 or 4 is probably best
options = 4;
// the content that will go in our main text box
scroller.htmlText = "homepage";
// puts the content into the text box
// create a new TextFormat object
myTextFormat = new TextFormat();
// Next three lines assing the font type, size, and color
myTextFormat.font = "verdana";
myTextFormat.size = smallestSize+difference;
myTextFormat.color = 0x333333;
// applies this textformat to the "mainContent" text box.
scroller.setTextFormat(myTextFormat);
for (i=0; i<options; i++) {
// create a temporary variable to store the text size
temp = (smallestSize+(i*difference));
// make some simple buttons
_root.createEmptyMovieClip(i, 100+i);
_root[i].lineStyle(2, 0xCCCCCC, 100);
_root[i].beginFill(0xCC6633, 100);
_root[i].moveTo(-12, -12);
_root[i].lineTo(12, -12);
_root[i].lineTo(12, 12);
_root[i].lineTo(-12, 12);
_root[i].endFill(-12, -12);
_root[i]._x = ((130)+(i*35));
_root[i]._y = 20;
// the next 5 lines are a really long way of saying "put a letter "A" on my button, and make it the size that it represents
_root["aTextFormat"+i] = new TextFormat();
_root["aTextFormat"+i].size = (temp);
_root[i].createTextField("tinyText", 200+i, (-5-i), (-5-i), 20, 20);
_root[i].tinyText.text = "A";
_root[i].tinyText.setTextFormat(_root["aTextFormat"+i]);
// set up a variable that will live forever on the button, denotint its text size
_root[i].mySize = temp;
// when this button gets pressed, call the "changeSize" function
_root[i].onRelease = function() {
changeSize(this.mySize);
};
}
changeSize = function (newSize) { myTextFormat.size = newSize;scroller.setTextFormat(myTextFormat);myScrollbar.setScrollTarget(scroller);};
// check every frame to see if COMMAND/CONTROL and "+" or "-" are being pressed. If so, change text size.
_root.onEnterFrame = function() {
if (Key.isDown(17) && Key.isDown(187)) {
myTextFormat.size = myTextFormat.size+difference;
scroller.setTextFormat(myTextFormat);
} else if (Key.isDown(17) && Key.isDown(189)) {
myTextFormat.size = myTextFormat.size-difference;
scroller.setTextFormat(myTextFormat);
}
};

Posted by: tony on May 27, 2004 04:00 AM

i am using external text files in Flash, but for some reason text at the bottom of the of the files doen't appear. i use BBEdit and zap any gremilns that might be there...also, it is all unicode plain text...what is the problem?

Posted by: Ken kelleher on October 1, 2004 02:00 AM

Thank you for the info. I used what you posted but instead of using , I used • to represent the bullet character and the wrapped the whole text string in CSS tags to apply any additional formatting. To my knowledge this is the only way to color the text, but also the only way to mix TEXTFORMAT with CSS.

-yuki

Posted by: yuki on November 2, 2004 07:18 PM

i am creat the media cd.
i have title is 147. this title is load left box and
this title click and display load text file right text box

please help me sample file

ok

|------------| |------------|
| titletext | | |
| file | | |
| | |load text
| load | fole (click
| title text)

Posted by: gitoo on November 23, 2004 08:30 AM

How can I insert external html source (text file) into flash? I'm using MX and it seems like the tag is not read as html... How is it possible to insert and external image into a scrollable textfield?

Posted by: paul on December 31, 2004 03:39 AM

hello friend

can you help me. I had a question in flash

I am making a project in flash, and part of its idea

is to make a button calling file html. the problem is

how could I call it to open in cd instead of my

computer.


thanks in advance

Posted by: ana on February 14, 2005 04:05 PM

a href tag doesn't work in flashmx.. everytime i put it on the external txt file it displays blank.. wiithout the link it works fine.. help! anyone? =)

Posted by: rico lajom on March 16, 2005 05:59 AM

a href tag doesn't work in flashmx.. everytime i put it on the external txt file it displays blank.. wiithout the link it works fine.. help! anyone? =)

Posted by: rico lajom on March 16, 2005 04:42 PM

Does the link you add to the file contain any ampersands (&) chars? You have to escape them otherwise flash will interpret them as the beginning of another variable. Try to replace every occurence of "&" with "%26".

Posted by: Mario Klingemann on March 16, 2005 04:47 PM

if there are any characters that mess up the hyperlink, try the ASCII code(like the "%26" Mario suggested for "&")...
http://www.cplusplus.com/doc/papers/ascii.html

Posted by: Ian on March 23, 2005 08:21 PM

I was looking for a long time trying to find the EURO signs hex value. here it is:

EURO %A4
POUND SIGN %A3

when importing txt from text files you need these hex values to get the currency sign to show up in flash

Posted by: mk on April 3, 2005 04:36 PM
Post a comment
Name:


Email Address:


URL:


Comments:


Remember info?



Thank you!

Most Visited Entries
Sketches, Works & Source Code
Lectures
Contact
Backlog
In Love with
Powered by
Movable Type 2.661

© Copyright Mario Klingemann

Syndicate this site:
RSS 1.0 - RSS 2.0

Quasimondo @ flickr
Quasimondo @ LinkedIn
Quasimondo @ Twitter
Quasimondo @ Facebook
Quasimondo @ MySpace
Quasimondo is a Bright
Citizen of the TRansnational Republic
My other blog in german
Impressum


My family name is written Klingemann,
not Klingelmann, Klingeman, Klingaman, Kingemann,
Kindermann, Killingaman, Klingman, Klingmann, Klingonman
Klingemman, Cleangerman, Klingerman or Kleangerman

profile for Quasimondo at Stack Overflow, Q&A for professional and enthusiast programmers