I’m very confused. When I instantiate a class, I’m assuming that the object is reset to its default variable values. Not so. Consider this:
class ClassTest extends MovieClip{
var arr:Array = new Array();
function ClassTest(){
trace("length="+arr.length);
arr.push(1);
}
}
If I put an instance of this class on each of 2 scenes, the output is:
length=0
length=1
…even if the two objects have different instance names! It’s as if it is making my arr variable static by default, and not resetting it to a new array in the second instance. How do I get around this? Do I need to somehow have this code instantiate itself with something like “this = new ClassTest();”
Thanks for any help!