2009-05-29 75 views
0
private function google(event:ResultEvent):void 
      { 
       Alert.show(event.result.loginsuccess.keyword[0]); 
       subtitle.visible=true; 
       Results.visible=true; 
       Occur.visible=true; 
       query.visible=true; 
       subtitle.text = "Search results for " + event.result.loginsuccess.keyword[0]; 
       Results.text = event.result.loginsuccess.name; 
       Occur.text = event.result.loginsuccess.occur; 
       query.text = "query executed in " + event.result.loginsuccess.queryTime[0] + " Seconds"; 
      } 
<mx:Text id="Results" x="130.5" y="180" text="Text" width="461" visible="false" fontWeight="bold" fontSize="16"/> 

我正在獲取此文本字段中的網站列表,但我需要讓它們可點擊。我該怎麼做。我的意思是網站的列表是隨機的,可能是三,四或許多。在Flex中創建鏈接

我從後端獲取的格式是PHP,並通過XML獲取Flex中的響應。

回答

1

使用HTML文本,你需要自己從你得到什麼結果從PHP回生成它。

[Bindable] 
private var link : String = '<p>some text here <a href="http://stackoverflow.com/questions/925492/creating-links-in-flex">stackoverflow</a> blah blah blah</p><p>even more text here <a href="http://www.bbc.co.uk">bbc</a> blah blah blah</p>'; 

然後在文本字段,

<mx:Text htmlText="{link}" 
/>