상세 컨텐츠

본문 제목

플래시 AS3.0 TextField htmlText 에 html 스타일 적용

ADOBE/ ActionScript

by AlrepondTech 2012. 2. 1. 14:56

본문

반응형

 

 

 

=================================

=================================

=================================

 

 

 

 

 

 

public static var HT_HEAD_S:String  = "<html><head></head><body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' bgcolor='#ebeef2'><div class='talk_list'>";
   
public static var HT_HEAD_E:String  = "<br></div></body></html>";

public function loadHtml():void
{
           var myCSS:StyleSheet = new StyleSheet();
            myCSS.setStyle("body", {fontSize:'18',color:'#D1D2D5', fontWeight:'bold'});
            myCSS.setStyle("body", {fontSize:'15',color:'#000066'});
            myCSS.setStyle("h1", {fontSize:'25',color:'#000000'});
            myCSS.setStyle("h2", {fontSize:'19',color:'#000000'});
            myCSS.setStyle("a:link", {color:'#0000CC',textDecoration:'none'});
            myCSS.setStyle("a:hover", {color:'#0000FF',textDecoration:'underline'});
            myCSS.setStyle("b", {fontWeight:'bold'});
            myCSS.setStyle("em", {fontWeight:'bold'});
            myCSS.setStyle("bodychat", {fontFamily:'HYHeadLine-M', fontSize:'18',color:'#D1D2D5', fontWeight:'bold'});

            var _webdata:String = "";
            var _chatView:TextField = new TextField();
            _webdata = HT_HEAD_S;

              temData = " <bodychat>"+"안녕하세요."+"</bodychat>"
           
            _webdata = temData + HT_HEAD_E;
            _chatView.htmlText = _webdata;
            _chatView.styleSheet = myCSS;
           
           
        }


참조 사이트:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StyleSheet.html

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#htmlText

 

 

=================================

=================================

=================================

 

 

반응형


관련글 더보기

댓글 영역