Functions

Why does this code not work?:
in frame:
[AS]function movement(object, key, xspeed, yspeed) {
if (Key.isDown(key)) {
object._x += xspeed;
object._y += yspeed;
}
}[/AS]

in mc:
[AS]onClipEvent (enterFrame) {
movement(this, Key.RIGHT, 10, 0);
movement(this, Key.LEFT, 0, 10);
}[/AS]