# Movement Using Keyboard Keys

**URL:** <https://forum.kirupa.com/t/movement-using-keyboard-keys/155537>\
**Category:** flash\
**Created:** [July 18, 2005, 6:40pm UTC](https://forum.kirupa.com/t/movement-using-keyboard-keys/155537 "2005-07-18T18:40:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![muddymac](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@muddymac](https://forum.kirupa.com/u/muddymac)\
**Post date:** [July 18, 2005, 6:40pm UTC](https://forum.kirupa.com/t/movement-using-keyboard-keys/155537/1 "2005-07-18T18:40:20Z")

</div>

I’m working with the “Movement Using Keyboard Keys” tutorial, question is this: I am looking to have the image ease to position so I was trying this syntax:

on (keyPress “\<Up\>”) {  
speed=10;  
if (holder.\_y\>-300) {  
holder.\_y -= holder.\_y/speed;

```
}

```

}

Works great for one arrow but disables the others??? any help???

thanks.

my code:

on (keyPress “\<Up\>”) {  
if (holder.\_y\>-300) {  
holder.\_y -= speed;

```
}

```

}  
on (keyPress “\<Right\>”) {  
if (holder.\_x\<0) {  
holder.\_x += speed;  
}  
}  
on (keyPress “\<Down\>”) {  
if (holder.\_y\<0) {  
holder.\_y += speed;  
}  
}  
on (keyPress “\<Left\>”) {  
if (holder.\_x\>-300) {  
holder.\_x -= speed;  
}  
}
