明天的明天 永远的永远 未知的一切 我与你一起承担 ??

是非成败转头空 青山依旧在 几度夕阳红 。。。
  博客园  :: 首页  :: 管理

Flex : 编写超链接。。。。。。。。。

Posted on 2009-10-30 09:17  且行且思  阅读(560)  评论(0编辑  收藏  举报
<?xml version="1.0" encoding="utf-8"?>    
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initApp()"    
layout
="absolute" width="278" height="244">    
<mx:Script>    
   
<![CDATA[    
      
     internal function initApp():void{    
      var str:String = "<a target='_blank' href='http://hi.baidu.com/hxd0818/'>paraliseinhell</a>";    
       link.htmlText = str;    
     }    
        
        private function toUrl():void { 
var urlstr : String = "http://www.baidu.com"; 
navigateToURL(new URLRequest(urlstr),"_blank"); 
}       
    
   
]]>    
</mx:Script>    
   
<mx:Button x="72" y="117" label="paraliseinhell" fontSize="13" id="link2" click="toUrl()"/>    
   
<mx:Text id="link" text="paraliseinhell" x="72" y="47" fontSize="13"/>    
</mx:Application>   
要图方便,可以考虑这种形式:
xx.htmlText=" <a href='xxxx'>"