在 Flex 中将文本显示为超链接 [英] Display text as hyperlink in Flex

查看:33
本文介绍了在 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 有一个 LinkBut​​ton 组件将执行此操作.(注意,如果您使用的是 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆