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?
but this doesn't make sense, '..they are calling a the same function within the objects..'. the functions should be unique to each class instance unless you're using a static function.
are there any static functions/variables in your class?
if not, what are you doing that makes you think changing one array changes a different array?
Ahh... yes I just did some thorough testing and realised the objects are not affecting eachother... there is problem with the code in the class (which always worked before, but I think I accidentally changed it and had no back up )... I will post back here if I can't fix the problem.