# Simple script: a counter, some timers, and falling mcs

**URL:** https://forum.kirupa.com/t/simple-script-a-counter-some-timers-and-falling-mcs/321444
**Category:** Uncategorized
**Created:** [April 20, 2011, 1:19am UTC](https://forum.kirupa.com/t/simple-script-a-counter-some-timers-and-falling-mcs/321444 "2011-04-20T01:19:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![alyssahhhh](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@alyssahhhh](https://forum.kirupa.com/u/alyssahhhh)
#### Post date: [April 20, 2011, 1:19am UTC](https://forum.kirupa.com/t/simple-script-a-counter-some-timers-and-falling-mcs/321444/1 "2011-04-20T01:19:39Z")

</div>

I’m currently creating a project that requires a counter to determine the number of movieclips that have reached a certain Y value.

```auto
var righthiptime:Timer = new Timer(3);

function righthipfall(event:TimerEvent): void {
	righthip_mc.y++;
	righthip_mc.rotation++;
	
	if (righthip_mc.y==750) {
		righthiptime.stop();
		counter++;
	}
}

righthiptime.addEventListener(TimerEvent.TIMER, righthipfall);
righthip_mc.addEventListener(MouseEvent.MOUSE_DOWN, righthiptimer);

function righthiptimer(event:MouseEvent): void {
	righthiptime.reset();
	righthiptime.start();
	
	
}

```

There are 41 sets of these functions, one for each movieclip. When the counter reaches 41, there is an if statement that causes a second set of movieclips to be visible.

```auto
if (counter==40) {
	mhead_mc.visible=true;
mbelly_mc.visible=true;
mbelly1_mc.visible=true;
mchest_mc.visible=true;
mleftarm_mc.visible=true;
mleftarm2_mc.visible=true;
mleftshoulder_mc.visible=true;
mrightarm_mc.visible=true;
mtit_mc.visible=true;

mpelvis_mc.visible=true;

}

```

does this statement need to be inside of a function? Regardless, it’s not working. Any scripting tips?
