# Actions continue after key is released

**URL:** https://forum.kirupa.com/t/actions-continue-after-key-is-released/166724
**Category:** programming
**Created:** [October 22, 2005, 3:02am UTC](https://forum.kirupa.com/t/actions-continue-after-key-is-released/166724 "2005-10-22T03:02:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![wham](https://avatars.discourse-cdn.com/v4/letter/w/e9bcb4/32.png) [@wham](https://forum.kirupa.com/u/wham)
#### Post date: [October 22, 2005, 3:02am UTC](https://forum.kirupa.com/t/actions-continue-after-key-is-released/166724/1 "2005-10-22T03:02:43Z")

</div>

```auto
onClipEvent (enterFrame) {
	with (_root.shuttle) {
		mySpeed = 40;
		myRot = 15;
		asky = Key.getAscii();
		if (Key.isDown(Key.DOWN) || asky == 115) {
			_y += mySpeed;
		}
		else {
			_y += 0; }

```

This is a portion of the code for a game I am trying to make.  
I am trying to make a movie clip move whenever the W,A,S,D or  
arrow keys are pressed. For some reason, whenever I press the W,A,S or D keys, it moves and won’t stop instead of moving only once. I am pretty sure that I need to use the Key.isDown for this, but whenever I put “115” (the ascii keycode for S), or Key.isDown(Key.S), it doesn’t do anything. Any ideas on the proper syntax?  
Thanks in advance.
