# Sticky keys in ninja game

**URL:** https://forum.kirupa.com/t/sticky-keys-in-ninja-game/58887
**Category:** Uncategorized
**Created:** [July 26, 2004, 9:12pm UTC](https://forum.kirupa.com/t/sticky-keys-in-ninja-game/58887 "2004-07-26T21:12:34Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sushideJaneiro](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@sushideJaneiro](https://forum.kirupa.com/u/sushideJaneiro)
#### Post date: [July 26, 2004, 9:12pm UTC](https://forum.kirupa.com/t/sticky-keys-in-ninja-game/58887/1 "2004-07-26T21:12:34Z")

</div>

this game i made requires constant num pad key presses and does an attack corresponding to which number u press. Sometimes though, flash seems to retain the keycode of a key. For example, you press num 3 and you get the num 3 attack. then you press num 5 but you get both the num 5 and num 3 attacks. it stays like this even if the page is refreshed or the browser is restarted. has anyone ever experienced this before and/or knows of a workaround?

you can try the game at [http://www.sushidejaneiro.com/issai.html](http://www.sushidejaneiro.com/issai.html)

the glitch seems to occur randomly, but when it does it pretty much ruins the game.

---

<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: [July 26, 2004, 9:43pm UTC](https://forum.kirupa.com/t/sticky-keys-in-ninja-game/58887/2 "2004-07-26T21:43:49Z")

</div>

hey, cool game! it’s not sticking for me!

🙂

---

<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: [July 27, 2004, 2:06am UTC](https://forum.kirupa.com/t/sticky-keys-in-ninja-game/58887/3 "2004-07-27T02:06:49Z")

</div>

yeh dude it works fine for me.

---

<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: [July 27, 2004, 4:27am UTC](https://forum.kirupa.com/t/sticky-keys-in-ninja-game/58887/4 "2004-07-27T04:27:34Z")

</div>

maybe its gone for good? _knock on wood_

---

<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: [July 27, 2004, 2:01pm UTC](https://forum.kirupa.com/t/sticky-keys-in-ninja-game/58887/5 "2004-07-27T14:01:41Z")

</div>

It’s not sticking, but make it so you can only do one attack at a time.

---

<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: [July 27, 2004, 3:30pm UTC](https://forum.kirupa.com/t/sticky-keys-in-ninja-game/58887/6 "2004-07-27T15:30:38Z")

</div>

i tried something like that. In the keydown function, there was a “delete this.onKeyDown” which would remove the keydown function and in the keyup function, it would reset the keydown function. unfortunately, it didn’t solve the problem and it also removed the advantage that the female character has (being able to attack more than once).
