2014-01-30 55 views
0

我有一个TextField。 这里是一个片段:img标签在actionscript3中无法正常工作TextField

this.textField = new TextField(); 
this.textField.defaultTextFormat = font.format; 
this.textField.selectable = true; 
this.textField.border = true; 
this.textField.wordWrap = true; 
this.textField.multiline = true; 

这里是新行添加到文本字段框的方法:

this.textField.htmlText = 'some text <IMG SRC="http://gravitatestudio.com/wp-content/themes/gravitate/images/facebook.png">'; 

的问题是,图像总是被放置在文本,而不是年底文本。

这里是HTML文本后的痕迹(this.textField.htmlText)已添加:

<P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="12" COLOR="#FFFFFF" LETTERSPACING="0" KERNING="0">some text <FONT SIZE="2"><IMG SRC="http://gravitatestudio.com/wp-content/themes/gravitate/images/facebook.png"> </FONT></FONT></P> 

此外,我需要用微笑的图像添加到像聊天消息文本中的任意一侧(左,文字的中间,右侧)。

有什么建议吗?

回答

1

TextField html文本非常有限,这就是为什么Adobe发布了TLFTextFields,这会让您更多地控制该领域中元素的布局。我曾亲自使用它,并已取得全部的聊天记录了一个文本框与图片,链接等

资源: 土坯:http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/text/TLFTextField.html

教程: http://flashsimulations.com/2010/09/10/handling-image-loading-in-tlf-textflow-and-textfield/

+0

应该帮助我。 谢谢。 – stryker

+0

@IvanK你好。 – mihai