# Getting an error trying to make WASD movement work

**URL:** <https://forum.kirupa.com/t/getting-an-error-trying-to-make-wasd-movement-work/273682>\
**Category:** flash\
**Created:** [October 18, 2008, 10:18pm UTC](https://forum.kirupa.com/t/getting-an-error-trying-to-make-wasd-movement-work/273682 "2008-10-18T22:18:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DuxMagnus](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@DuxMagnus](https://forum.kirupa.com/u/DuxMagnus)\
**Post date:** [October 18, 2008, 10:18pm UTC](https://forum.kirupa.com/t/getting-an-error-trying-to-make-wasd-movement-work/273682/1 "2008-10-18T22:18:57Z")

</div>

Hi everyone

I am trying to make a character move using the W, A, S, D kets but I am getting a big error. Every time I test the code it says:

Coercion failed: cannot convert flash.events to flash.events.KeyBoardEvent

Here is my code thus far:

stage.addEventListener(KeyboardEvent.KEY\_DOWN, gameLoop);  
function gameLoop (event:KeyboardEvent):void{

```
if(event.keyCode == 65)
{
    xspeed = xspeed-power;
}

```

There is more, but this is the stuff just having to do with movement using the keys. What am I doing wrong??
