package net.coolcc.resource 
{
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	
	/**
	 * ...
	 * @author 
	 */
	public class ReLabel extends Sprite
	{
		private var textfield:TextField;
		
		public function ReLabel() 
		{
			//文本框
			textfield = new TextField();
			textfield.x = 0;
			textfield.y = 0;
			textfield.autoSize = TextFieldAutoSize.NONE;
			textfield.text = '';
			textfield.selectable = false;
			textfield.border = false;
			addChild(textfield);
		}
		
		//
		public function set text(value:String):void 
		{
			textfield.text = value;
		}		
		
		public function get text():String { return textfield.text; }
		
		//
		public function set autoSize(value:String):void
		{
			switch(value) {
				case 'LEFT':
					textfield.autoSize = TextFieldAutoSize.LEFT;
					break;
				case 'RIGHT':
					textfield.autoSize = TextFieldAutoSize.RIGHT;
					break;
				case 'CENTER':
					textfield.autoSize = TextFieldAutoSize.CENTER;
					break;
				default:
					textfield.autoSize = TextFieldAutoSize.NONE;
			}
			textfield.autoSize = value;
		}
		
		public function get autoSize():String { return textfield.autoSize; }
		
		//
		public function set selectable(value:Boolean):void
		{
			textfield.selectable = value;
		}
		
		public function get selectable():Boolean { return textfield.selectable; }
		
		//
		public function set border(value:Boolean):void
		{
			textfield.border = value;
		}
		
		public function get border():Boolean { return textfield.border; }
	}
	
}