开发者

AS3 bug? Newline automatically entered after css tag

开发者 https://www.devze.com 2023-03-15 09:38 出处:网络
I am rendering a TextField (Flash CS5) with the following css and html properties : css = \"a {font-weight: bold;} fu {colo开发者_运维百科r: #00A0A0;}\"

I am rendering a TextField (Flash CS5) with the following css and html properties :

css = "a {font-weight: bold;} fu {colo开发者_运维百科r: #00A0A0;}"
wordWrap = true
multiline = true
html = <![CDATA[&quot;Phoenicians were pioneering artisans and ingenious craftsmen…

They developed the technique behind the production of transparent glass…

Their innovation spread around the globe throughout the past centuries…

<fu>WE AIM TO CARRY ON WITH THE INNOVATION</fu>&quot;]]>

The last QUOTE is rendered in a line BELOW "WE AIM TO...". It's rendered like this :

...

WE AIM TO CARRY ON WITH THE INNOVATION

"

The ONLY way to render the quote in the same line with "WE AIM..." is to :

a) Either put it INSIDE <fu>

b) Or remove <fu> altogether.

Is this a Flash bug? Am I doing something wrong with css or html?

Many thanks in advance,

Bill


The problem here is that htmlText supports only a limited number of tags and attributes, and thus CSS support is frankly quite poor. So it is not a bug, but a known limitation...

My recommendation would be to use a span tag with a class attribute, like:

css = ".foo {color: #00A0A0;}"

html = "&quot;[...]the past centuries…
<span class=\"foo\">WE AIM TO CARRY ON WITH THE INNOVATION</span>&quot;";


Instead of going the complex "span" way, just add this in you css description:

css = "a {font-weight: bold;} fu {color: #00A0A0; display:inline;}"

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号