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