# Noob question

**URL:** https://forum.kirupa.com/t/noob-question/23788
**Category:** Uncategorized
**Created:** [June 22, 2003, 10:32am UTC](https://forum.kirupa.com/t/noob-question/23788 "2003-06-22T10:32:14Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Nicke](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@Nicke](https://forum.kirupa.com/u/Nicke)
#### Post date: [June 22, 2003, 10:32am UTC](https://forum.kirupa.com/t/noob-question/23788/1 "2003-06-22T10:32:14Z")

</div>

Here is an really noob question. How do a make an object on release to slide down slowly say 30 px on the y axis and, when clicking on it a second time go back up 30 px.  
thx guys

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 22, 2003, 11:25am UTC](https://forum.kirupa.com/t/noob-question/23788/2 "2003-06-22T11:25:28Z")

</div>

Use the on (press) action attached to the movie clip. Inside the brackets, adjust the \_y property, for example \_root.movieclip.\_y = \_root.movieclip.\_y -30.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 22, 2003, 12:03pm UTC](https://forum.kirupa.com/t/noob-question/23788/3 "2003-06-22T12:03:32Z")

</div>

ok but how do i make it slide down not just jump 30 down ?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 22, 2003, 12:48pm UTC](https://forum.kirupa.com/t/noob-question/23788/4 "2003-06-22T12:48:29Z")

</div>

Well, the object you have should then be a button, ( I called it thisobject here ) with the as:

[AS]  
on(release){  
if (\_root.targY == positionminus30){  
\_root.targY = \_root.thisobject.\_y;  
} else {  
\_root.targY = \_root.thisobject.\_y - 30;  
}  
}  
[/AS]

Add another empty movieclip (CTRL+F8), giev it any name and drag it from the library (F11) to the stage (doesn’t matter where). Now apply this code to it:

[AS]  
onClipEvent(load){  
\_root.targY = originalobjectposition;  
}  
onClipEvent(enterFrame){  
\_root.thisobject.\_y = \_root.targY - (\_root.targY - \_root.thisobject.\_y)/1.2;  
}  
[/AS]

That should work. I can’t test it though cuz I ain’t got flash here.
