# Why isnt this working?

**URL:** <https://forum.kirupa.com/t/why-isnt-this-working/211000>\
**Category:** Uncategorized\
**Created:** [December 25, 2006, 1:37pm UTC](https://forum.kirupa.com/t/why-isnt-this-working/211000 "2006-12-25T13:37:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adbul](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@Adbul](https://forum.kirupa.com/u/Adbul)\
**Post date:** [December 25, 2006, 1:37pm UTC](https://forum.kirupa.com/t/why-isnt-this-working/211000/1 "2006-12-25T13:37:20Z")

</div>

stop();  
shipX = 20;  
speed = 10;  
function update() {  
ship\_mc.\_x = shipX;  
}  
function checkKeys() {  
if (Key.isDown(Key.RIGHT)) {  
shipX += speed;  
ship\_mc.gotoAndStop(1);  
}  
else if (Key.isDown(Key.LEFT)){  
shipX -= speed;  
ship\_mc.gotoAndStop(2);  
}  
else if (Key.isDown(Key.SPACE));{  
speed = 1  
}  
}  
onEnterFrame = function () {  
checkKeys();  
update();  
};

but speed is now always 1.  
WHY?
