package classes.gustavo.midia.teclado
{
	
	import flash.display.SimpleButton;
	import flash.display.Sprite;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	

	
	public class Teclado extends Sprite
	{
		
		private var limpar						:Sprite;
		private var espaco						:Sprite;
		
		private var t1							:Tecla;
		private var t2							:Tecla;
		private var t3							:Tecla;
		private var t4							:Tecla;
		private var t5							:Tecla;
		private var t6							:Tecla;
		private var t7							:Tecla;
		private var t8							:Tecla;
		private var t9							:Tecla;
		private var t10							:Tecla;
		private var t11							:Tecla;
		private var t12							:Tecla;
		private var t13							:Tecla;
		private var t14							:Tecla;
		private var t15							:Tecla;
		private var t16							:Tecla;
		private var t17							:Tecla;
		private var t18							:Tecla;
		private var t19							:Tecla;
		private var t20							:Tecla;
		private var t21							:Tecla;
		private var t22							:Tecla;
		private var t23							:Tecla;
		private var t24							:Tecla;
		private var t25							:Tecla;
		private var t26							:Tecla;
		private var t27							:Tecla;
		private var t28							:Tecla;
		private var t29							:Tecla;
		private var t30							:Tecla;
		private var t31							:Tecla;
		private var t32							:Tecla;
		private var t33							:Tecla;
		private var t34							:Tecla;
		private var t35							:Tecla;
		private var t36							:Tecla;
		private var t37							:Tecla;
		private var t38							:Tecla;
		private var t39							:Tecla;
		private var t40							:Tecla;
		
		public function Teclado() 
		{
			
			limpar								= _limpar;
			espaco								= _espaco;
			
			t1									= _t1;
			t2									= _t2;
			t3									= _t3;
			t4									= _t4;
			t5									= _t5;
			t6									= _t6;
			t7									= _t7;
			t8									= _t8;
			t9									= _t9;
			t10									= _t10;
			t11									= _t11;
			t12									= _t12;
			t13									= _t13;
			t14									= _t14;
			t15									= _t15;
			t16									= _t16;
			t17									= _t17;
			t18									= _t18;
			t19									= _t19;
			t20									= _t20;
			t21									= _t21;
			t22									= _t22;
			t23									= _t23;
			t24									= _t24;
			t25									= _t25;
			t26									= _t26;
			t27									= _t27;
			t28									= _t28;
			t29									= _t29;
			t30									= _t30;
			t31									= _t31;
			t32									= _t32;
			t33									= _t33;
			t34									= _t34;
			t35									= _t35;
			t36									= _t36;
			t37									= _t37;
			t38									= _t38;
			t39									= _t39;
			t40									= _t40;
			
			limpar.buttonMode = espaco.buttonMode = true;
			
			limpar.addEventListener(MouseEvent.CLICK, clear);
			espaco.addEventListener(MouseEvent.CLICK, space);			
			
			t1.setLetra("1");
			t2.setLetra("2");
			t3.setLetra("3");
			t4.setLetra("4");
			t5.setLetra("5");
			t6.setLetra("6");
			t7.setLetra("7");
			t8.setLetra("8");
			t9.setLetra("9");
			t10.setLetra("0");
			t11.setLetra("Q");
			t12.setLetra("W");
			t13.setLetra("E");
			t14.setLetra("R");
			t15.setLetra("T");
			t16.setLetra("Y");
			t17.setLetra("U");
			t18.setLetra("I");
			t19.setLetra("O");
			t20.setLetra("P");
			t21.setLetra("A");
			t22.setLetra("S");
			t23.setLetra("D");
			t24.setLetra("F");
			t25.setLetra("G");
			t26.setLetra("H");
			t27.setLetra("J");
			t28.setLetra("K");
			t29.setLetra("L");
			t30.setLetra("Z");
			t31.setLetra("X");
			t32.setLetra("C");
			t33.setLetra("V");
			t34.setLetra("B");
			t35.setLetra("N");
			t36.setLetra("M");
			t37.setLetra("-");
			t38.setLetra("_");
			t39.setLetra(".");
			t40.setLetra("@");
			
			t1.onSelect							= addToCampo;
			t2.onSelect							= addToCampo;
			t3.onSelect							= addToCampo;
			t4.onSelect							= addToCampo;
			t5.onSelect							= addToCampo;
			t6.onSelect							= addToCampo;
			t7.onSelect							= addToCampo;
			t8.onSelect							= addToCampo;
			t9.onSelect							= addToCampo;
			t10.onSelect						= addToCampo;
			t11.onSelect						= addToCampo;
			t12.onSelect						= addToCampo;
			t13.onSelect						= addToCampo;
			t14.onSelect						= addToCampo;
			t15.onSelect						= addToCampo;
			t16.onSelect						= addToCampo;
			t17.onSelect						= addToCampo;
			t18.onSelect						= addToCampo;
			t19.onSelect						= addToCampo;
			t20.onSelect						= addToCampo;
			t21.onSelect						= addToCampo;
			t22.onSelect						= addToCampo;
			t23.onSelect						= addToCampo;
			t24.onSelect						= addToCampo;
			t25.onSelect						= addToCampo;
			t26.onSelect						= addToCampo;
			t27.onSelect						= addToCampo;
			t28.onSelect						= addToCampo;
			t29.onSelect						= addToCampo;
			t30.onSelect						= addToCampo;
			t31.onSelect						= addToCampo;
			t32.onSelect						= addToCampo;
			t33.onSelect						= addToCampo;
			t34.onSelect						= addToCampo;
			t35.onSelect						= addToCampo;
			t36.onSelect						= addToCampo;
			t37.onSelect						= addToCampo;
			t38.onSelect						= addToCampo;
			t39.onSelect						= addToCampo;
			t40.onSelect						= addToCampo;
			
		}
		
		private function space(e:MouseEvent):void 
		{
			var p:String = " ";
			//dispatchEvent(new Eventos(Eventos.ON_ADDTEXT, p));
		}
		
		private function addToCampo(letra:String):void
		{			
			//dispatchEvent(new Eventos(Eventos.ON_ADDTEXT, letra));			
			trace(letra);
		}
		
		public function clear(e:MouseEvent):void
		{
			
			//dispatchEvent(new Eventos(Eventos.ON_DELTEXT));
			
		}		
		
	}
	
}