adding hyperlink inside a text component in flex

I’ve discovered 2 ways to add hyperlink to a text component in flex:

  1. to use the click handler and navigateTo method as shown in my previous blog entry hyperlink in flex
  2. 2. an alternate way is to add it inside htmlText attribute. Doing it this way, you don’t need to use URLRequest object. All you need to do is to add the hyperlink as you would in html then escape < and > by replacing them with < and >.
    Example:
    <mx:Text htmlText="&lt;a href='http://yahoo.com'&gt;yahoo home page&lt;/&gt;" />

Got something to say?