# If I only instantiate a class once should I make all its vars static?

**URL:** <https://forum.kirupa.com/t/if-i-only-instantiate-a-class-once-should-i-make-all-its-vars-static/303845>\
**Category:** flash\
**Created:** [January 27, 2010, 11:49pm UTC](https://forum.kirupa.com/t/if-i-only-instantiate-a-class-once-should-i-make-all-its-vars-static/303845 "2010-01-27T23:49:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shaedo](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Shaedo](https://forum.kirupa.com/u/Shaedo)\
**Post date:** [January 27, 2010, 11:49pm UTC](https://forum.kirupa.com/t/if-i-only-instantiate-a-class-once-should-i-make-all-its-vars-static/303845/1 "2010-01-27T23:49:29Z")

</div>

If I only instantiate a class once should I make its vars static?

I understand how this is of benefit if I make multiple classes, clearly you use less memory as it creates a reference to the same place for each class. Are there any other benefits for creating static vars or functions ?

For example I have my class ‘MainMenu’ which I create once (might even be my document class). In it I create a

```auto
private var someHolderForStuff:Sprite = new Sprite();

```

should I rather create

```auto
private static var someHolderForStuff:Sprite = new Sprite();

```
