Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/12/2011, 14:36
devilboy9999
 
Fecha de Ingreso: octubre-2009
Mensajes: 125
Antigüedad: 14 años, 6 meses
Puntos: 2
Pregunta [Duda] Pequeña clase

tengo la sig clase en actionscript


Código:
public class Conversor
	{
		private var etiqueta:Label;
		private var numero:String;
		
		public function Conversor(etiqueta:Label,numero:String):void
		{			
			this.etiqueta = etiqueta;
			this.numero = numero;				
		}
		
		public function binario():void
		{
			etiqueta.text = "";
			var obj:Object = (new int(numero)).toString(2);
			etiqueta.text = obj.toString();
		}
		
		
		
	}
y la quiero ejecutar de la sig forma:

Código:
private var obj:Conversor = new Conversor(resultado,"2");
obj.binario();
Pero al hacerlo me muestra el sig error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

el error está en la funcion binario, xq si yo comento lo de adentro no hay error

me podrían ayudar por favor??