Movieclip click and textfield problem

Hello, I have a movieclip that I need to click on so that a variable gets changed.

the code of the movie clip is:

onClipEvent(mouseDown)
{
//if (_global.ccc=1)
//{
//_global.ccc=0
//}
//else
//{
_global.ccc=_global.ccc+1
trace(ccc)
//}
}
onClipEvent(load)
{
_global.ccc=0
}
problems:

  1. It is supposed that in each click the _global.ccc variable is increased by 1. According to the trace, it does. But in the dynamic textbox doesn’t update.

  2. The value is increased every time I click on the entire movie not the movieclip. How can I fix this?

i think that mouseDown triggers whenever anywhere is clicked. try onPress instead. also maybe put ‘textboxname.text = _global.ccc’ in whenever you change it.


onClipEvent(load)
{
  _global.ccc=0;
  onPress = function() {
    _global.ccc=_global.ccc+1;
          trace(ccc);
     [textboxname].text = _global.ccc;
  }
}