/ Published in: ActionScript 3
note to self - Basic settings for clean text in as3 flash project assuming fonts are embedded.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
private function set_text(_txt:String, _size:Number, _font:String, _width:Number=250, txt_color:uint = 0x00CADF ):TextField{ var txt:TextField = new TextField(); var fmt:TextFormat = new TextFormat(); fmt.font = _font; fmt.size = _size; fmt.leading = 1.5; fmt.kerning = true; fmt.color = txt_color; txt.embedFonts = true; txt.defaultTextFormat = fmt; txt.multiline = true; txt.wordWrap = true; txt.antiAliasType ='advanced'; txt.width = _width; txt.autoSize = 'left'; txt.text = _txt; return txt ; }