4 Replies Latest reply on Jul 7, 2010 6:37 AM by UbuntuPenguin

    Weird problem with a custom class and a vector.

    NickDF__ Level 1

      Hello.... I'm having a very weird problem with a vector in my application.

       

      Details...

       

      I have the following classes.

       

      Person,Player,PlayerController.

       

      Player extends Person. Person extends ObjectProxy in order to enable binding.

      So the Player class has the [Bindable] tag.

       

      The PlayerController class has a remote object calling a php method to receive a firstname and a lastname and when the callresponder gets the result from the call it creates a Player instance. At that moment I am trying to push the player object into a Vector.<Player>.

       

      The problem is the following.

       

      Every time the push method is called, the vector is being populated with the last player that was created but not just in the end of the vector. It replaces the other instances as well! So the vector always contains the most recent player instance but in every position of it. :S

       

      I have also tried doing it with an Array and the results are the same.

       

      Any thoughts on what I'm doing wrong? It's driving me crazy. :S