Thanks Muzak, I'm blind. Thanks a lot.

-----Mensaje original-----
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre de Muzak
Enviado el: jueves, 25 de mayo de 2006 10:13
Para: Flashcoders mailing list
Asunto: Re: [Flashcoders] Object's popertys definition problem ¿?

you have to create/set the array's in the constructor.

  private var cantidad:Number;
  private var ruta:Array;
  private var nombre_ruta:Array;
 //-----CONSTRUCTOR
  public function Ruta() {
    ruta = new Array();
    nombre_ruta = new Array();
    cantidad = 0;
 }

regards,
Muzak

----- Original Message ----- 
From: "Jorge Antonio Diaz Gutierrez" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
Sent: Thursday, May 25, 2006 3:52 PM
Subject: [Flashcoders] Object's popertys definition problem ¿?


Hi there, I have a problem. This class doesn't work correctly.

When I create an Object, all it's property's values become undefined even if I 
Insert Items trough the "Nueva_Ruta" method. When I 
Call the "SHOW ALL" method for tracing , all Array items are empty/undefined.
I really need help about it.
I don't understand this behavior. I'm Using Flash Develop.

Thanks a lot.

//--------------------------CLASS ------------------------------
class Ruta
{
 //----- 
 private var cantidad:Number;
  private var ruta:Array;
  private var nombre_ruta:Array;
 //-----CONSTRUCTOR
  public function Ruta() {
     cantidad = 0;
 }
 //--------- INSERT METHOD
 public function Nueva_Ruta(nombre:String, pruta:String):Void{
     ruta.push(pruta);
     nombre_ruta.push(nombre);
     cantidad++;
 }
//---------- SHOW ALL
 public function Todas_las_Rutas():Array {
     var nombres_rutas:Array = new Array;
     for(var i:Number = 0; i < cantidad ; i++){
        nombres_rutas[i] = nombre_ruta[i] + " (" + ruta[i] + ")";
     }
  return nombres_rutas;
 }
}


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to