I encountered a rather irritating problem yesterday. I wrote a class. The class has got 1 variable of the type :Array. its a public variable.
On the scene i have 2 movieclips which are connected to my class through its linkage in the library.
My problem is that even though the instance-variable (the array) is supposed to be unique for the instance only it gets overwritten for every new instance i create.
for example. if i assign the first instance’s array 2 values (1, 1)
and the do the same with the second but here i change the values to (2,2)
then when i check my first instance it has got the same values as the second instance…that is (2,2).
Does anyone know whats wrong here?
the Class
class Temps extends MovieClip{
public var arr_Temps:Array = new Array();
function Temps(){}
function fillArray(param_1,param_2){
this.arr_Temps[0] = param_1;
this.arr_Temps[1] = param_2;
}
}
the fla
sqr1.fillArray(sqr2,sqr2);
sqr2.fillArray(sqr3,sqr3);
BR
Joakim Carlgren