# Help with horizontal sliding

**URL:** https://forum.kirupa.com/t/help-with-horizontal-sliding/275250
**Category:** Uncategorized
**Created:** [November 11, 2008, 6:30pm UTC](https://forum.kirupa.com/t/help-with-horizontal-sliding/275250 "2008-11-11T18:30:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![media\_mixx](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@media\_mixx](https://forum.kirupa.com/u/media_mixx)
#### Post date: [November 11, 2008, 6:30pm UTC](https://forum.kirupa.com/t/help-with-horizontal-sliding/275250/1 "2008-11-11T18:30:14Z")

</div>

I am working with a downloaded component that moves separate panels horizontally with an ease. there are 4 panels and they are controlled by 4 buttons to make them move.  
The code for the panels is:

onClipEvent (load) {  
targetx = 46.0;  
delay = 8;  
}  
onClipEvent (enterFrame) {  
distx = targetx-\_x;  
\_x += distx/delay;  
}

The code for each button is:

on (release) {  
menu.targetx = 46.0;  
}

The value changes with each button to move the panels.

My question is the buttons are actually buttons and I want to make them into movie clips  
but when I do that and apply the same code it does not work.

Can this only be done with “buttons”?

I am trying to create a portfolio section that slides from panel to panel by thumbnails and left and right arrows.

Any help would be appreciated.
