2014-01-30 48 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