# Static Variables

**URL:** <https://forum.kirupa.com/t/static-variables/329071>\
**Category:** flash\
**Created:** [July 18, 2012, 3:25am UTC](https://forum.kirupa.com/t/static-variables/329071 "2012-07-18T03:25:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanDaMan](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@DanDaMan](https://forum.kirupa.com/u/DanDaMan)\
**Post date:** [July 18, 2012, 3:25am UTC](https://forum.kirupa.com/t/static-variables/329071/1 "2012-07-18T03:25:26Z")

</div>

I have a class that instantiates a public static variable (referencing another object). There is only one instance of this class at a time, and upon its deletion it sets the variable to null to allow for garbage collection. When a new instance of this class is created (after the deletion of the first) the variable is still set to null. If the variable is not static, however, I do not have this problem. Why is this?
