# If statement question

**URL:** https://forum.kirupa.com/t/if-statement-question/321383
**Category:** Uncategorized
**Created:** [April 18, 2011, 6:06pm UTC](https://forum.kirupa.com/t/if-statement-question/321383 "2011-04-18T18:06:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kbowk](https://avatars.discourse-cdn.com/v4/letter/k/9de053/32.png) [@kbowk](https://forum.kirupa.com/u/kbowk)
#### Post date: [April 18, 2011, 6:06pm UTC](https://forum.kirupa.com/t/if-statement-question/321383/1 "2011-04-18T18:06:47Z")

</div>

Hi Kirupa,

I have the following piece of code, which checks a dynamic text field on the click of a button and if the text field is 3 it plays one movie clip and if it is not it displays another:

```auto
private function checkAnswer(event:MouseEvent):void {
			if (answerText.text == "3")
			{
				correct_mc.play();
			}
				else
			{
				wrong_mc.play();
				answerText.text = null;
			}
			
	}

```

This works fine, however, after getting the answer wrong, it takes an extra mouse click to register.

So it plays the wrong\_mc movie clip, then if you click again nothing happens. Then the next click it works and will play it again.

Anyone have any thoughts?

Kbowk
