码迷,mamicode.com
首页 > 其他好文 > 详细

TextField link事件

时间:2016-05-14 12:48:02      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:

package  {
    import flash.display.MovieClip;
    import flash.text.TextField;
    import flash.events.TextEvent;
    
    public class TextFildTest extends MovieClip{

        public function TextFildTest() {
            // constructor code
            var textFiled:TextField = new TextField();
            textFiled.name = "_textFiled";
            textFiled.htmlText = "<a href=‘event:typetext‘>con</a>"; 
            textFiled.addEventListener(TextEvent.LINK,linkhandle);
            addChild(textFiled);
        }
        
        private function linkhandle(event:TextEvent):void{
            trace(event.type);   //link
            trace(event.text);    //typetext
            trace(event.target.text) ;   //con
            trace(event.target.name);
         }
    }
}

 

TextField link事件

标签:

原文地址:http://www.cnblogs.com/jiangjieqim/p/5492294.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!