package  clases{
	import flash.display.MovieClip;
	import flash.text.TextField;
	import flash.events.MouseEvent;
	import fl.text.TLFTextField;
	
	public class tecladoNX extends MovieClip{
		
		public var caja:TLFTextField
		public var texto:String = ""
		public var borrador:MovieClip
		public var maximoCaracteres:int
		
		public function tecladoNX() {
		
		
		this.borrador.addEventListener(MouseEvent.CLICK,borrar)
		this.borrador.buttonMode = true
		this.borrador.useHandCursor = true
		
		}
		public function cambioTexto(caracter){

			caja = MovieClip(this.parent).foco
			//trace(caja.maxChars)
			texto = caja.text
			if(texto.length<caja.maxChars){
			texto += caracter
			caja.text = texto
			
			}
			//trace(texto)
			}
			
		public function borrar(event){
			caja = MovieClip(this.parent).foco
			caja.replaceText(caja.length-1,caja.length,"")
			texto = caja.text 
			
			}
			
		
	}
	
}
