闪光灯无视我我大部分的标签在HTML的文本字段 [英] Flash is ignoring my most of my tags in a HTML TextField

查看:186
本文介绍了闪光灯无视我我大部分的标签在HTML的文本字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在努力,现在弄清楚了一会儿。我通常设法使我的文本框的正常工作,但是这仅仅是我发疯。

I've been trying to figure out for a while now. I usually manage to make my textFields work properly, but this is just driving me nuts.

我有这样的文本字段,我注入的HTML格式的文本(包含在一个XML文件)。出于某种原因,我几乎所有的标签都被忽略(< B> < I> < U> < UL> <李> )。我只能得到它的渲染< BR /> 标签正确。我可以用一个样式表,但我不认为这会令我的名单的工作......

I have this TextField that I inject HTML formatted text (contained in a XML file). For some reason, almost all my tags are ignored (<b>,<i>,<u>,<ul> and <li>). I can only get it to render <br /> tags properly. I could use a StyleSheet, but I don't think it would make my lists work...

下面的事情是如何设置:

Here's how things are set up:

文字我注入:

<text>
    <![CDATA[<b>Some bold text </b>and some normal text <br/><u>This text is underlined</u> normal text to compare<br/><i/>This text is italic</i>]]>
</text>

我如何文本字段设置:

How my TextField is set:

// When my Class' setup method is called, I set those properties
_tf = _transcript.getTextFormat();
_tf.font = "Verdana";
_tf.size = 12;
_transcript.embedFonts  = true;
_transcript.multiline   = true;
_transcript.autoSize    = TextFieldAutoSize.LEFT;
_transcript.wordWrap    = true;

// In an function, later on
_transcript.htmlText = transcript;  // transcript is a parameter. Basically, the XML I wrote above
_transcript.setTextFormat(_tf);

我DO 已经Verdana字体嵌入(以及变体)。我确信通过生成大小报告跟踪Font.enumerateFonts()。如果我的输出文本域的的htmlText在已经建立起来,我得到这样的:

I DO have Verdana embed (as well as the variants). I made sure by generating a size report and tracing Font.enumerateFonts(). If I output the textField's htmlText after having set it up, I get this:

&LT; p align =left&GT;&LT; FONT FACE =宋体SIZE =12COLOR =#FFFFFF字母间距=0字距=0&GT;一些大胆的文字和一些正常的文字&lt; / FONT&GT;&LT; / P&GT;&LT; p align =left&GT;&LT; FONT FACE =宋体SIZE =12COLOR =#FFFFFF字母间距=0 字距=0&gt;这带下划线的文字普通文本比较&LT; / FONT&GT;&LT; / P&GT;&LT; p align =left&GT;&LT; FONT FACE =宋体SIZE =12COLOR = #FFFFFF字母间距=0字距=0&gt;这斜体文字&LT; / FONT&GT;&LT; / P&GT;

我真的没了主意,为什么没有任何的工作,如果任何人有任何想法,我真的AP preciate它!

I'm really out of ideas on why nothing's working, if anyone had any idea, I'd really appreciate it!!

感谢您

编辑:所以,我决定测试其在我的XML无CDATA,并添加&LT; B&GT; 在我的AS3 $ C标记$ C。没有任何工作。我不明白我怎么能有我的字体正确地嵌入,但Flash拒绝使用它们。

So I decided to test having no CDATA in my XML, and adding the <b> tag in my AS3 code. Didn't work either. I don't get how I can have my fonts correctly embed, but Flash refusing to use them.

推荐答案

确定要得到这个工作,我已经使用的语法如下:

Ok to get this to work, I have used the following syntax:

<mx:Text>
    <mx:htmlText>
        <![CDATA[<b>Some bold text </b>and some normal text <br/><u>This text is underlined</u> normal text to compare<br/><i/>This text is italic</i>]]>
    </mx:htmlText>
</mx:Text>

我没有尝试,包括任何额外的脚本,你必须在你的问题,但它似乎确定处理html标签是这样的。

I didnt try including any of the extra script you have in your question, but it seems to handle the html tags ok like this.

另外这里是LiveDocs中引用我来检查我的语法...

Also here is the livedocs reference I used to check my syntax...

http://livedocs.adobe.com/柔性/ 3 / HTML / help.html?内容= textcontrols_04.html

回首你的问题我刚刚意识到,你可能不使用Flex,好了,所以这是Flex的具体,很抱歉。

Looking back at your question I've just realised that you probably aren't using Flex, ok so this is Flex specific, sorry.

这篇关于闪光灯无视我我大部分的标签在HTML的文本字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆