forked from: forked from: flash on 2010-3-1

by h_sakurai forked from forked from: flash on 2010-3-1 (diff: 6)
♥0 | Line 29 | Modified 2011-01-26 12:23:21 | MIT License
play

ActionScript3 source code

/**
 * Copyright h_sakurai ( http://wonderfl.net/user/h_sakurai )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/uMyb
 */

// 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);
        }
    }
}