我從這個樣子的服務器得到的字符串:格式鏈接到瀏覽器中打開它在Flex移動項目
This is normal text followed by a link;
http://www.google.com
Links might also look like this;
http://google.com/whatever
這個字符串被設置爲在火花文本區域的文本值。我想要實現的是 A.文本被突出顯示,並且 B.用戶可以點擊它並在系統瀏覽器中打開。
任何幫助將不勝感激!
編輯:使用StyleableTextField在Flex 4.6上引發typerror。 我嘗試了這樣最簡單的HTML文本;
StyleableTextField(newsStoryArea.textDisplay).htmlText = "TextArea <b>bold</b><i>italic</i>."
哪扔;
TypeError: Error #1034: Type Coercion failed: cannot convert
spark.components.supportClasses::[email protected] to
spark.components.supportClasses.StyleableTextField.
編輯: 不錯的一個Adobe! 「htmlText in mobile skins
您不能在移動應用程序中使用htmlText屬性。」
在同一頁上(http://help.adobe.com/en_US/flex/mobileapps/WS19f279b149e7481c698e85712b3011fe73-7fff.html#WS19f279b149e7481c7c94ce7c12b30152f48-7ffc),他們說不要在移動皮膚使用TLF,所以沒有按的htmlText」 t工作,不應使用TLF。 基本上只有兩個選項(除非有第三個選項我不知道)才能正確格式化鏈接,不能在移動設備上使用。大!
有什麼建議嗎?
你的意思是你想產生'thetext'或類似的東西? – fge 2012-01-12 09:38:26
這將是第一步,我將使用正則表達式來解決這個問題。然而,爲移動設備開發我是最快的解決方案。第二步是在設備的瀏覽器中打開這些鏈接,我不確定它是否會在TextArea中自動支持。 – AlBirdie 2012-01-12 09:43:17
我知道你可以使用StyleableTextField添加一個支持鏈接的eventListener,但是在Flex 4.6中似乎存在一個bug,因爲從textArea到StyleableTextField的強制轉換不起作用。 – AlBirdie 2012-01-12 09:46:14