在Flex中将文本显示为超链接 [英] Display text as hyperlink in Flex
问题描述
<mx:VBox id="paSenate" label="PA Senate" width="100%" verticalGap="0">
<mx:HBox>
<mx:Label text="PA Senate" fontWeight="bold"></mx:Label>
<mx:Label id="paSenateConf" text="" />
</mx:HBox>
<mx:Label id="paSenateNameLabel" text="" paddingLeft="5"/>
<mx:Label id="paSenateCountyLabel" text="" paddingLeft="5"/>
<mx:Label id="paSenateURLLabel" text="" paddingLeft="5"/>
</mx:VBox>
上面的代码显示了基于地址搜索的结果。所有显示的信息都来自数据库或Web服务。包括参议院和众议院成员的网址。该网站是作为一个字符串回来的。现在它只是被传入paSenateURLLabel的文本字段。我需要改变它到一个超链接,所以它是可点击的。这是在Flex 3.5中完成的。不完全确定我将如何去做这件事。
The code I have above displays results based on an address search. All the information being displayed is coming from either database or a web service. Including the web address for Senate and House members. The website is coming back as a string. Right now it is just simply being passed into the text field of paSenateURLLabel. I need to change it somehow to a hyperlink so it's clickable. This is being done in Flex 3.5. Not entirely sure how I would go about doing this.
推荐答案
Flex 3有一个 LinkButton 组件。 (注意,如果您使用的是Flex 4,您只需为 Button
创建基于文本的外观,或者使用具有超链接功能的TLF文本。)
Flex 3 has a LinkButton component that will do this. (Note, if you were using Flex 4 you would just make text based skin for a Button
or use TLF text which has hyperlink functionality.)
<mx:LinkButton label="I'm a link" click="linkClickhandler()" />
这篇关于在Flex中将文本显示为超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!