Incrementing a Variable with buttons

I’ve followed several tutorials on how to do this, but my dynamic text box always returns a value of “Nan” when I try to increment it’s value.
I’ve been trying to use

_root.total = _root.total + 1;

] in an on release function. Even if i managed to get this to work though, I still need to reuse the variable i’m incrementing within other calculations.

If anyone could show me how to get this working, and re-use the variable. It would be much appreciated.