Problems with my array

What i want is that when i click a button, for it to increment a textbox.

I have given the variable name counter to my text box.

and on the button i put this code

on (release){
for (counter = 1;counter<10;++counter);
}

when i try to run it i get the following message.

Error Scene=Scene 1, layer=Layer 7, frame=1:Line 1: Mouse events are permitted only for button instances
on (release){

Total ActionScript Errors: 1 Reported Errors: 1

Can someone help me?

Is this what you mean?

on (release){
var tmp = new Number(counter.text);
counter.text = tmp++;
}