Lately I had to create an interesting workflow for a Flex Application. I had to change the default behavior of Label, Text and TextArea components so that when users click on a hyperlink, instead of opening that url into the same window, open it into a popup window.
Now when the htmlText property is dynamic, it needs to be parsed and prefix each url with ‘event:’. Thanks to the support for Regular Expressions in Flex, this task is really simple. The code bellow does the replacement:
htmlText.replace( /href=(\'|\")/ , "href=$1event:" );
If you want to see a complete sample on how to capture the link event, you can go to : Adobe Flex Help – Text Controls