# Just learning need help

**URL:** <https://forum.kirupa.com/t/just-learning-need-help/173352>\
**Category:** flash\
**Created:** [December 23, 2005, 8:35pm UTC](https://forum.kirupa.com/t/just-learning-need-help/173352 "2005-12-23T20:35:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Terry\_elekes](https://avatars.discourse-cdn.com/v4/letter/t/8baadc/32.png) [@Terry\_elekes](https://forum.kirupa.com/u/Terry_elekes)\
**Post date:** [December 23, 2005, 8:35pm UTC](https://forum.kirupa.com/t/just-learning-need-help/173352/1 "2005-12-23T20:35:17Z")

</div>

I was playing around with the code below and I have a question:

onClipEvent (load) {  
speed = 0;  
}  
onClipEvent (enterFrame) {  
if (Key.isDown(Key.RIGHT)) {  
this.\_x += 5;  
if (this.\_x\>=400) {  
this.\_x -= 5;  
}  
}  
}  
When I pree the right key it moves to the right. Then i put the if statement that when it hits 400 I wanted the key right to change the direction. Also i seta variable speed =0, How could I use that(speed) to change how fast it moves.
