# Click counter script not working

**URL:** https://forum.kirupa.com/t/click-counter-script-not-working/78969
**Category:** Uncategorized
**Created:** [February 9, 2005, 2:37pm UTC](https://forum.kirupa.com/t/click-counter-script-not-working/78969 "2005-02-09T14:37:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ellare](https://avatars.discourse-cdn.com/v4/letter/e/919ad9/32.png) [@ellare](https://forum.kirupa.com/u/ellare)
#### Post date: [February 9, 2005, 2:37pm UTC](https://forum.kirupa.com/t/click-counter-script-not-working/78969/1 "2005-02-09T14:37:36Z")

</div>

1. my counting click script doesnt work. cant figure out why ((I’m not that good at if statements))

2. why does my red box move along a diagonal and not more randomly?

3. since my click counter script doesnt work, my dynamic text box loadMessage doesnt work?

i originally started this thought here:  
[http://www.kirupa.com/forum/showthread.php?t=84023&highlight=counting](http://www.kirupa.com/forum/showthread.php?t=84023&highlight=counting)

this is my button script:  
on (press){  
filenamea = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]  
a = filenamea.length;  
k = Math.floor(Math.random()\*a); //creates random #

filenameB = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]  
b = filenameB.length;  
m = Math.floor(Math.random()\*b); //creates random #

this.\_x = k_m; //new x location  
this.\_y = k_m; //new y location

var i = 0  
i++  
if (i==10)  
{\_root.loadMessage = “you’ve clicked 10 times, give it up”};

}

where as loadMessage is the variable name on a dynamic text box on the root.

please help
