# Instantiated class does not revert to its defaults?!?

**URL:** <https://forum.kirupa.com/t/instantiated-class-does-not-revert-to-its-defaults/241411>\
**Category:** flash\
**Created:** [October 13, 2007, 2:48pm UTC](https://forum.kirupa.com/t/instantiated-class-does-not-revert-to-its-defaults/241411 "2007-10-13T14:48:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZenBlender](https://avatars.discourse-cdn.com/v4/letter/z/a4c791/32.png) [@ZenBlender](https://forum.kirupa.com/u/ZenBlender)\
**Post date:** [October 13, 2007, 2:48pm UTC](https://forum.kirupa.com/t/instantiated-class-does-not-revert-to-its-defaults/241411/1 "2007-10-13T14:48:49Z")

</div>

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:

```auto
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:

```auto
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!
