TextField Leading Sample on 2011-8-23

by momolab
♥0 | Line 18 | Modified 2011-08-23 15:05:15 | MIT License
play

ActionScript3 source code

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

package {
    import flash.text.TextFormat;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.display.Sprite;
    public class TextFieldLeadingSample extends Sprite {
        public function TextFieldLeadingSample() {
            var format:TextFormat = new TextFormat();
            format.size = 20;
            format.leading = Number(format.size) * -0.2;
            
            var tf:TextField = new TextField();
            tf.defaultTextFormat = format;
            tf.autoSize = TextFieldAutoSize.LEFT;
            tf.text = "이거슨 leading 테스트 입니다.\n 아아아 잘부탁 드림\n이거슨 leading 테스트 입니다.\n 아아아 잘부탁 드림\n이거슨 leading 테스트 입니다.\n 아아아 잘부탁 드림\n이거슨 leading 테스트 입니다.\n 아아아 잘부탁 드림\n";
            addChild(tf);
        }
    }
}