Need help with variables

I was kinda wondering how to make global var’s?
I made a variable at the main time line
var goodch:Number = 0;
if (goodch==5)
{gotoandplay(4);}

And a string at a movie clip that adds +1 to goodch when clicked.
on (press)
{goodch +=1;}

I’ve pressed 5 times, nothing happened. Trace(goodch) always return undefined and trace(int(goodch)) always 0 ;