# \[MX\] Need help getting IF Stament working!

**URL:** https://forum.kirupa.com/t/mx-need-help-getting-if-stament-working/9767
**Category:** flash
**Created:** [December 18, 2002, 7:28am UTC](https://forum.kirupa.com/t/mx-need-help-getting-if-stament-working/9767 "2002-12-18T07:28:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![byis](https://avatars.discourse-cdn.com/v4/letter/b/5e9695/32.png) [@byis](https://forum.kirupa.com/u/byis)
#### Post date: [December 18, 2002, 7:28am UTC](https://forum.kirupa.com/t/mx-need-help-getting-if-stament-working/9767/1 "2002-12-18T07:28:08Z")

</div>

Well I finally got my script working, however im trying to make it so that user can use ENTER key on keyboard in place of the enter button in my MC if they want and also would like to be able to use CTRL+Z in place of use the clear button in my MC. I put in an IF Statement but its not working. Anyone mind looking at my code and see whats wrong?

Thanks!

---

<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 18, 2002, 7:37am UTC](https://forum.kirupa.com/t/mx-need-help-getting-if-stament-working/9767/2 "2002-12-18T07:37:40Z")

</div>

Well see. Key.isDown only works on onEnterFrame in situation likes this… instead of making a whole new movie clip, just do this…

```auto
_root.createEmptyMovieClip("container", 1);
_root.container.onEnterFrame = function() {
	if (Key.isDown(Key.CONTROL) && Key.isDown(90)) {
		output = spaces;
		input = spaces;
	}
};

```

Works like a charm.

---

<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 18, 2002, 7:59am UTC](https://forum.kirupa.com/t/mx-need-help-getting-if-stament-working/9767/3 "2002-12-18T07:59:54Z")

</div>

Thanks Lost! At least I had the logic correct :). I still have problems relating the AS to MC, Buttons, Etc…

---

<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 18, 2002, 8:01am UTC](https://forum.kirupa.com/t/mx-need-help-getting-if-stament-working/9767/4 "2002-12-18T08:01:40Z")

</div>

Well I figured that out a while back after banging my head up against the wall for a while trying to figure out why it wasn’t working…lol.
