# Remove button hit!

**URL:** https://forum.kirupa.com/t/remove-button-hit/10140
**Category:** flash
**Created:** [December 25, 2002, 11:35am UTC](https://forum.kirupa.com/t/remove-button-hit/10140 "2002-12-25T11:35:34Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![jerry](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@jerry](https://forum.kirupa.com/u/jerry)
#### Post date: [December 25, 2002, 11:35am UTC](https://forum.kirupa.com/t/remove-button-hit/10140/1 "2002-12-25T11:35:34Z")

</div>

Hey guys!

I was wondering, I have a button with the following action:

```auto
on (release) {
	MyMC.gotoAndPlay(02);
}

```

Is there some way to remove the button hit while the animation of MyMC is running, so the user won’t be able to use the button until the animation is done? \<:}

---

<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: [December 25, 2002, 11:54am UTC](https://forum.kirupa.com/t/remove-button-hit/10140/2 "2002-12-25T11:54:11Z")

</div>

this should work … paste it into any movie clip actions

```php

onClipEvent (load) {
	this.stop()
}
onClipEvent (enterFrame) {
	if (this._currentframe == 1) {
		this.stop()
		this.enabled = true
	} else {
		this.enabled = false
	}
}
on (press) {
	this.play()
}

```

---

<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: [December 25, 2002, 11:58am UTC](https://forum.kirupa.com/t/remove-button-hit/10140/3 "2002-12-25T11:58:56Z")

</div>

Yeah, cool! But how do I assign the action to the buttons, I don’t wanna click the animation!?

---

<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: [December 25, 2002, 12:03pm UTC](https://forum.kirupa.com/t/remove-button-hit/10140/4 "2002-12-25T12:03:36Z")

</div>

NEVERMIND i got it - THX alot m8! 😛

---

<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: [December 25, 2002, 12:17pm UTC](https://forum.kirupa.com/t/remove-button-hit/10140/5 "2002-12-25T12:17:50Z")

</div>

Hmmm… new problem commig up: let’s say I have three buttons with three seperate animations, and I wan’t to disable the other two buttons while one animation is running, how can this be done? :\*(

---

<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: [December 25, 2002, 12:24pm UTC](https://forum.kirupa.com/t/remove-button-hit/10140/6 "2002-12-25T12:24:39Z")

</div>

```php
if (this._currentframe >= 2) {
	_root.buttonInstanceName.enabled = false
}

```

[size=1] **PS:** lol … I never use buttons … they’re useless to me [MX] … so I guess my brain automatically erases the word ‘button’ placing mc instead[/size]

---

<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: [December 25, 2002, 12:35pm UTC](https://forum.kirupa.com/t/remove-button-hit/10140/7 "2002-12-25T12:35:55Z")

</div>

please take a look at this example and tell me what is wrong?

---

<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: [December 25, 2002, 12:55pm UTC](https://forum.kirupa.com/t/remove-button-hit/10140/8 "2002-12-25T12:55:35Z")

</div>

what the hell is going on here??

if you press button 1 … lir 1 plays and disables both buttons  
if you press button 2 … lir 2 plays and keeps both buttons enabled  
I’ve used the same actionscript so I don’t know what’s the problem … :sleep:

give a moment and I’ll fix it [size=1][I hope :)][/size] … just wanted to tell you the progress

---

<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: [December 25, 2002, 12:56pm UTC](https://forum.kirupa.com/t/remove-button-hit/10140/9 "2002-12-25T12:56:40Z")

</div>

OKI - THX for helping out M8! =)

---

<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: [December 25, 2002, 1:03pm UTC](https://forum.kirupa.com/t/remove-button-hit/10140/10 "2002-12-25T13:03:22Z")

</div>

this is a completely different than my first attempt … but it works

---

<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: [December 25, 2002, 1:14pm UTC](https://forum.kirupa.com/t/remove-button-hit/10140/11 "2002-12-25T13:14:32Z")

</div>

YES it works - and with three buttons as well!

Once again, thx alot dude!

cheers \<:}

---

<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: [December 25, 2002, 1:18pm UTC](https://forum.kirupa.com/t/remove-button-hit/10140/12 "2002-12-25T13:18:43Z")

</div>

no problem 😏

glad to help
