As per my comment, this was my idea:
(We need to see the whole class to confirm this btw)
is
frame
a class int? like this:
class myclass{
int frame;
...
}
and is the class instantiated as new each time like:
var myvar = new myclass();
if that is the case then frame will be zero every time you instantiate the class. If you want the value to persist and still use
myclass
this way then you need
static int frame
.
Did I miss the mark on that one? This is mostly guess work without seeing the whole class you have written.