All pastes #948671 Raw Edit

Someone

public text v1 · immutable
·published 2008-03-19 11:12 UTC
rendered paste body
//all thats inside first frame of file
import TextObject;
var header = new TextObject(55, 5, "test", "0xAA0000", 200, 12, true);


//the class
package {
	import flash.text.*;
	import flash.display.Sprite;
	
	public class TextObject extends Sprite{
		public function TextObject(posX:int, posY:int, theText:String, fontColor:String, theWidth:int, fontSize:int, fontBold:Boolean){
			var textFieldObject:TextField = new TextField();
			textFieldObject.text = theText;
			textFieldObject.width = theWidth;
			textFieldObject.x = posX;	textFieldObject.y = posY;

			textFieldObject.selectable = false;
			textFieldObject.border = false;
			textFieldObject.autoSize = TextFieldAutoSize.LEFT;

			var textFormat:TextFormat = new TextFormat();
			textFormat.font = "Arial";
			textFormat.color = 0xAA0000;
			textFormat.size = 24;
			textFormat.bold = true;
			textFieldObject.setTextFormat(textFormat);		
			this.addChild(textFieldObject);		
		}
	}
}