# Move 1 movie clip with 4 different butns

**URL:** <https://forum.kirupa.com/t/move-1-movie-clip-with-4-different-butns/7163>\
**Category:** Uncategorized\
**Created:** [October 24, 2002, 8:45pm UTC](https://forum.kirupa.com/t/move-1-movie-clip-with-4-different-butns/7163 "2002-10-24T20:45:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jenkman](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@jenkman](https://forum.kirupa.com/u/jenkman)\
**Post date:** [October 24, 2002, 8:45pm UTC](https://forum.kirupa.com/t/move-1-movie-clip-with-4-different-butns/7163/1 "2002-10-24T20:45:32Z")

</div>

I am designing a site with four “pages” each page is on a different frame of the same timeline. I have four navigational buttons for each frame. I have a movieclip in the shape of a small triangle that indicates which button has been pressed.  
On the initial load of the site the arrow(triangle) is not shown on the “home” page. I would like for the arrowmc to show under the button that is pressed, then when another button is pressed the arrowmc would slide under that button. Say I press button A then button D the arrowmc would slide horizontally underneath button D. I think I need a function call for each onPress event but telling the movieclip which button to slide under is what is stumping me.  
Any help would be great.

---

<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:** [October 31, 2002, 7:58pm UTC](https://forum.kirupa.com/t/move-1-movie-clip-with-4-different-butns/7163/2 "2002-10-31T19:58:38Z")

</div>

that easy, just give every button this code:

on (release) {  
\_root.pressed = “D”;  
}

D is the letter of your button, eg. button A --\> A

then, give your mc the following code:

onClipEvent (enterFrame) {  
if (\_root.pressed == “A”) {  
this.\_y += (\*-this.\_y)/3;  
}  
if (\_root.pressed == “D”) {  
this.\_y += (\*\*-this.\_y)/3;  
}  
}

replace the \* by the Y-position of the A-button  
replace the \*\* by the Y-position of the B-button.

This way, your movieclip will slide under your button (because of the “/3”)
