Skip to main content
Inspiring
March 25, 2007
Question

<br/> is interpreted as </li><li> in TextField.htmlText

  • March 25, 2007
  • 2 replies
  • 270 views
I have a text filed created like this:
createTextField();
.type = "dynamic";
.multiline=true;
.html = true;
.htmlText = myText;

myText = "<ul><li> blah-blah blah-blah </li></ul>";

The problem is that the text is too long and I inserted <br/> in the middle
like that:
myText = "<ul><li> blah-blah <br/> blah-blah </li></ul>";

which works fine in HTML, but in FLASH this creats another list item as if
it was
myText = "<ul><li> blah-blah </li><li> blah-blah </li></ul>";

What is the problem and how do I get round it


This topic has been closed for replies.

2 replies

Inspiring
March 26, 2007
Thank you, David


Inspiring
March 25, 2007
aa,

> myText = "<ul><li> blah-blah blah-blah </li></ul>";

The UL tag is not supported in Flash, so you may omit it. (Search the
phrase "supported HTML tags" in the documentation to see the full subset of
supported tags -- it's a limited subset.)

> The problem is that the text is too long and I inserted
> <br/> in the middle like that:
> myText = "<ul><li> blah-blah <br/> blah-blah </li></ul>";
> which works fine in HTML, but in FLASH this creats
> another list item

I don't recall that I've ever experienced what you describe, but it
doesn't particularly surprise me. HTML formatting can be a very useful
thing in Flash -- but you have to fully appreciate how limited the support
is. I would do a bit of isolated experimentation in a new FLA to confirm
what you've discovered, and if that's truly what a BR tag does inside LI,
then you'll know to avoid that situation.

You may have to use the IMG tag to provide a "bullet" of your own and
follow it with content inside a P tag. Look into the StyleSheet class in
the ActionScript 2.0 Language Reference to see what your options are for
CSS. That, and/or the TEXTFORMAT tag will will allow you manipulate margins
in a way that lets you simulate bulleted lists.


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."