在 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()" />