Display text as hyperlink in Flex

回眸只為那壹抹淺笑 提交于 2019-12-10 17:17:46

问题


<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>

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.


回答1:


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


来源:https://stackoverflow.com/questions/12307464/display-text-as-hyperlink-in-flex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!