# Ease on Button Press

**URL:** <https://forum.kirupa.com/t/ease-on-button-press/300282>\
**Category:** flash\
**Created:** [November 18, 2009, 6:08pm UTC](https://forum.kirupa.com/t/ease-on-button-press/300282 "2009-11-18T18:08:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![KillCodyDead](https://avatars.discourse-cdn.com/v4/letter/k/a88e4f/32.png) [@KillCodyDead](https://forum.kirupa.com/u/KillCodyDead)\
**Post date:** [November 18, 2009, 6:08pm UTC](https://forum.kirupa.com/t/ease-on-button-press/300282/1 "2009-11-18T18:08:51Z")

</div>

I have a movie clip (panel2\_mc) that I want to move up and down on the press of a button (dropbtn). I have tried applying this code:

```auto
onClipEvent(load){						
_x=98;
_y=289;
speed=3;
}

dropbtn.on (press) {targety=90;}		
dropbtn.on (release) {targety=289;}

onClipEvent(enterFrame){
_y+=(targety-_y)/speed;
}

```

to the panel2\_mc movie clip, and have also tried applying this:

```auto
panel2_mc.onClipEvent(load){						
_x=98;
_y=289;
speed=3;
}

dropbtn.on (press) {targety=90;}		
dropbtn.on (release) {targety=289;}

panel2_mc.onClipEvent(enterFrame){
_y+=(targety-_y)/speed;
}

```

to the entire frame. Please tell me where I am going wrong?
