Forked from: hacker_amj3sk1e's forked from: flash on 2010-3-1 diff:6 forked from: forked from: flash on 2010-3-1 h_sakurai forked:0favorite:0lines:29license : MIT License modified : 2011-01-26 12:23:21 Embed Tweet // forked from hacker_amj3sk1e's forked from: flash on 2010-3-1 // forked from foo9's flash on 2010-3-1 package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFormat; import flash.text.AntiAliasType; import flash.text.TextFieldAutoSize; import flash.text.TextFieldType; public class FlashTest extends Sprite { private var textField:TextField; public function FlashTest() { textField = new TextField(); textField.width = 465; textField.height = 465; textField.background = true; textField.backgroundColor = 0xFFFFFF; textField.antiAliasType = AntiAliasType.ADVANCED; textField.multiline = true; textField.wordWrap = true; //textField.autoSize = TextFieldAutoSize.CENTER; // textField.type = TextFieldType.DYNAMIC; var textFormat:TextFormat = new TextFormat(); // textFormat.font = "MS ゴシック"; /** * ある程度大きい数字入れても変わらない。 */ textFormat.size = 10; //nankaifactory.com - TextField の setTextFormat() と defaultTextFormat //[http://www.nankaifactory.com/blog/2008/09/textfield-settextformat-defaul.html] textField.text = "ぽ。"; textField.defaultTextFormat = textFormat; addChild(textField); } } } Code Fullscreen Preview Fullscreen multiline height width text addChild Sprite