简单文本格式管理器AS3
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了简单文本格式管理器AS3相关的知识,希望对你有一定的参考价值。
http://leongaban.com/com/leongaban/Snipplr/Model/Fonts.as
package com.leongaban.Snipplr.Model { import flash.text.Font; import flash.text.TextFormat; import flash.text.TextFormatAlign; import flash.text.TextFieldAutoSize; import flash.text.*; public class Fonts { public static var data:Object = {}; public static var customFormat1 = new TextFormat(); public static var customFormat2 = new TextFormat(); customFormat1.font = "Arial"; customFormat1.size = 14; customFormat1.bold = true; customFormat1.color = 0x000000; customFormat1.align = TextFormatAlign.LEFT; customFormat2.font = "Arial"; customFormat2.size = 11; customFormat2.bold = false; customFormat2.color = 0x000000; customFormat2.align = TextFormatAlign.LEFT; } } // How to use in other Classes: /*videoTitle.defaultTextFormat = Fonts.customFormat1; videoTitle.border = false; videoTitle.embedFonts = false; videoTitle.selectable = false; videoTitle.mouseEnabled = false; videoTitle.x = 5; videoTitle.y = 8; videoTitle.width = titleSize; videoTitle.height = 30; videoTitle.text = titleString; addChild(videoTitle);*/
以上是关于简单文本格式管理器AS3的主要内容,如果未能解决你的问题,请参考以下文章
AS3里【TextField】于【TextArea】有啥区别?
AS3加载网页文本时候以HTML代码的形式显示了 我想让他以正常的方式显示,或者怎么解析HTML代码呢