# Problems with my array

**URL:** <https://forum.kirupa.com/t/problems-with-my-array/102207>\
**Category:** Uncategorized\
**Created:** [February 20, 2004, 10:06pm UTC](https://forum.kirupa.com/t/problems-with-my-array/102207 "2004-02-20T22:06:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigbadmilkman](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@bigbadmilkman](https://forum.kirupa.com/u/bigbadmilkman)\
**Post date:** [February 20, 2004, 10:06pm UTC](https://forum.kirupa.com/t/problems-with-my-array/102207/1 "2004-02-20T22:06:41Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 20, 2004, 10:48pm UTC](https://forum.kirupa.com/t/problems-with-my-array/102207/2 "2004-02-20T22:48:12Z")

</div>

Is this what you mean?

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