package
{
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.text.TextFormatAlign;
	
	public class FuncellButton extends Sprite
	{
		private var text:TextField;

		private var label:String;
		
		public function FuncellButton(label:String="按钮")
		{
			this.label = label;
			initUI();
		}
		
		private function initUI():void
		{
			
			this.graphics.beginFill(0x666666, 0.9);
			this.graphics.lineStyle(1, 0);			
			this.graphics.drawRoundRect(0,0,170, 50,10,10);
			this.graphics.endFill();
			text = new TextField();
			text.width = 170;
			text.height = 40;
			text.y = 1;

			text.wordWrap = true;
			text.multiline = true;
			text.mouseEnabled = false;
			
			var tf:TextFormat = new TextFormat("", 32, 0);
			tf.color = 0xffffff;
			tf.align = TextFormatAlign.CENTER;
			text.defaultTextFormat = tf;
			text.setTextFormat(tf);
			
			
			this.addChild(text);
			
			text.text = label;
		}
	}
}