# Key up stop at its position

**URL:** <https://forum.kirupa.com/t/key-up-stop-at-its-position/330009>\
**Category:** flash\
**Created:** [November 17, 2012, 3:15pm UTC](https://forum.kirupa.com/t/key-up-stop-at-its-position/330009 "2012-11-17T15:15:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ohya](https://avatars.discourse-cdn.com/v4/letter/o/fbc32d/32.png) [@ohya](https://forum.kirupa.com/u/ohya)\
**Post date:** [November 17, 2012, 3:15pm UTC](https://forum.kirupa.com/t/key-up-stop-at-its-position/330009/1 "2012-11-17T15:15:52Z")

</div>

I have a vertical line movie clip attach with the following script:  
onClipEvent (enterFrame)  
{ if(Key.isDown(Key.DOWN)) { this.\_yscale+=5; }  
if (Key.isDown(Key.UP)) { this.\_yscale-=5 ;}}  
the line keep on increasing in length when up and down key is pressed. I don’t want the line to go up further from its own location, that means the line can go up after pressing down key until its own point and don’t go up any further. Need help on this
