# onKeyDown question

**URL:** https://forum.kirupa.com/t/onkeydown-question/61976
**Category:** flash
**Created:** [August 23, 2004, 8:47pm UTC](https://forum.kirupa.com/t/onkeydown-question/61976 "2004-08-23T20:47:39Z")
**Posts on this page:** 1
**Showing post:** 7

<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: [August 26, 2004, 7:08pm UTC](https://forum.kirupa.com/t/onkeydown-question/61976/7 "2004-08-26T19:08:57Z")

</div>

no.  
but scarces method looks a bit daunting i gotta say 😉

on your code, before you perform any actions, ie. after all your onKey stuff and listeners and what not… before you actually DO what you want to do… put this before it

```auto
if(x!=2){

```

and the following just after your actions

```auto
x=2}

```

then close off all your key down stuff… then put an identical to your onKeyDown function but trading in Down with Upwith the following action:

```auto
{x=1}

```

if you give us the code you have at the moment we will be better able to demonstrate the simplicity of it

Prophet.

---

_[View the full topic](https://forum.kirupa.com/t/onkeydown-question/61976)._
