<? XML version = "1.0" encoding = "UTF-8"?> <S: Application xmlns: FX = "http://ns.adobe.com/mxml/2009" xmlns: S = "Library: // ns.adobe.com/flex/spark" xmlns: MX = "Library: // ns.adobe.com/flex/mx "minwidth =" 955 "minheight =" 600 "creationcomplete =" initapp () "> <FX: declarations> <! -- Place non-visual elements (such as services and value objects) Here --> </FX: declarations> <FX: SCRIPT> <! [CDATA [import flash.net. navigatetoURL; import MX. controls. alert; import MX. core. mx_internal; Private function initapp (): void {var STR: String = "<a href = 'HTTP: // www.baidu.com 'target = '_ blank'> text hyperlink </a> "; link.html text = STR;} private function handlehtmltextalertclick (): void {var link: string = "http://javacrazyer.iteye.com/" Var text: string = "<u> <a href = '" + link + "'target =' _ blank '> to Baidu </a> </u>"; var: alert = alert. show (text, "message"); // The key is the following sentence, which ensures support for HTML tags. mx_internal: alertform. mx_internal: textfield.html text = text;} private function Openurl (): void {navigatetoURL (New URLRequest ("http://www.baidu.com"), "_ blank");}]> </FX: SCRIPT> <mx: button x = "25" Y = "28" label = "button HYPERLINK" fontsize = "13" id = "link2" Click = "Openurl ()"/> <mx: button label = "Button out-of-box HYPERLINK" Click = "handlehtmltextalertclick ()" x = "25" Y = "76"/> <mx: text id = "Link" text = "text HYPERLINK" x = "25" Y = "137" fontsize = "13"/> </S: Application>