3 Replies Latest reply on May 5, 2014 8:59 AM by kglad

    Using arrays within classes

    prodigalmaster Level 2

      Hello, I have used an array within a class


      private var freeIDs:Array = new Array();


      And then created an object of this class and everything works. But when I create a second object of the same class, the arrays of each object seem to conflict, even though they are meant to be unique to each object. Am I misunderstanding this or is this a real problem?


      Basically I have 2 (or 3) objects of this class and they are calling a the same function within the objects at the same time, the function alters freeIDs. It seems when freeIDs is altered in one object, it changes in the other, which is unintentional. Individually the objects work but when there are two or more it doesn't work and weird buggy behaviour occurs. Is this to be expected?