2012-08-03 19 views

回答

0

http://forums.adobe.com/thread/756042

http://cookbooks.adobe.com/post_Hyperlink_Control-13867.html

這些鏈接爲您提供了有關如何創建一個鏈接,而不喜歡http://www.google.com/任何文字可以將這些鏈接將是有益的,以創建一個鏈接的信息!

但是你的問題看起來不同,所以首先你必須製作所有文本的html字符串,並且在那裏你想要一個鏈接的地方你必須把一個<A>標籤放在必要的attribut中,你需要一個特殊字符的地方使用其十六進制代碼html的轉義序列,如& = &amp;。我的意思是說,做一個沒有標籤的html字符串。然後給這個字符串<s:RichEditableText>看例子。

  1. 第一種方式。

    <s:RichEditableText> <s:content> <s:p> Here is a link: <s:a href="www.google.com"</s:a> </s:p> </s:content> </s:RichEditableText>

  2. 方式二。

// Your Actionscript code。

[Bindable] private var _testString:String= "<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="16" COLOR="#000000" LETTERSPACING="0" KERNING="0">&quot; this is a string containing silly characters like &lt;and &gt; they look a hyperlink <FONT COLOR="#0000FF"><A HREF="http://www.google.com" TARGET="_blank"><B><I><U>http://www.google.com</U></I></B></A></FONT>&quot;</FONT></P></TEXTFORMAT>";

//你的MXML內容

<mx:RichTextEditor id="richEditableText1" 
         width="100%" 
         htmlText="{testString}" 
         height="100%"/> 

祝您好運!

相關問題