# \[AS2\] Static variable issues

**URL:** <https://forum.kirupa.com/t/as2-static-variable-issues/302933>\
**Category:** flash\
**Created:** [January 10, 2010, 6:43pm UTC](https://forum.kirupa.com/t/as2-static-variable-issues/302933 "2010-01-10T18:43:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mental](https://avatars.discourse-cdn.com/v4/letter/m/c77e96/32.png) [@Mental](https://forum.kirupa.com/u/Mental)\
**Post date:** [January 10, 2010, 6:43pm UTC](https://forum.kirupa.com/t/as2-static-variable-issues/302933/1 "2010-01-10T18:43:30Z")

</div>

Hi,

I’m currently having some baffling issues with a variable tracing as undefined if I don’t make it static within one of my classes but I don’t want it to be static as I will be using more than one instance of the class at a time and it will need different values.

Basically, one class is creating a new instance of another then running a function which should trace this variable but it just says it is undefined.

This is the line I’m using to call it:

```auto
getRoot()["pause"].onRelease = Delegate.create(this, timer.pause_Timer);

```

The pause\_Timer function in the timer should just trace that one variable I mentioned but it won’t, unless it’s static.

I’ve attached a zip of the whole thing too because I doubt this will give enough information.

p.s. For some reason my getRoot function and root variable also have to be static otherwise they won’t call :shifty:, even though I have used that exact same code elsewhere and it will work without.

Thanks in advance for any help,  
Mental.
