hyperlink in flex
Adding a simple hyperlink in flex is not as simple as using a getURL method in flash.
It's not that much more complicated, but enough to confuse a beginner because it uses a method that takes a particular type of object (URLRequest) as its parameter insted of a string for the URL. So you need to create the URLRequest first before you can call the method to take the user to that URL (the method is called navigateToURL).
If you want to write it all in one line, you can do it as follow (example below show you how to apply the hyperlink to a LinkButton object):
<mx:LinkButton id="sample_button" label="click me!" click="navigateToURL(new URLRequest('http://finance.yahoo.com'), '_blank')" />
I find this to be the easiest and quickest way to do this, but it might not be the best way to do it especially if the url is dynamic.
You should also try out the way Adobe folks recommend in the flex documentation so you'd understand the difference.

June 2nd, 2007 at 6:56 pm
[…] to use the click handler and navigateTo method as shown in my previous blog entry hyperlink in flex […]
September 1st, 2007 at 5:00 pm
Danny,
Thanks!
Thanks especially for having the wit to title your post “hyperlink in flex” which gets this page super high ranking on google searches using the terms: hyperlink flex
Also thanks for the link to the related Adobe documentation page. Very professional. (btw, that Adobe doc page no where uses either of the words link or hyperlink. Net result, that Adobe doc page will never show up on google searches using the terms I mentioned: hyperlink flex).
g
November 2nd, 2007 at 9:45 am
The above has problems when the URL is to an office document. IE prompts with Open, Save & Cancel buttons, when you access an office document and the above seems to leave the pop-up window open when you choose Save or cancel. Open is fine. Has any one seen this behavior?
Raj.
July 31st, 2008 at 2:39 am
Cool, it was very helpful…! Perhaps i cant get y u said “but it might not be the best way to do it especially if the url is dynamic.”
It worx great for me if i use the variable name instead of URL.