Return to Snippet

Revision: 31747
at September 15, 2010 19:59 by leongaban


Updated Code
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);*/

Revision: 31746
at September 12, 2010 00:29 by leongaban


Initial Code
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);*/

Initial URL


Initial Description
http://leongaban.com/com/leongaban/Snipplr/Model/Fonts.as

Initial Title
Simple TextFormat Manager AS3

Initial Tags
flash

Initial Language
ActionScript 3