# Sliding content

**URL:** <https://forum.kirupa.com/t/sliding-content/173959>\
**Category:** Uncategorized\
**Created:** [December 31, 2005, 3:44pm UTC](https://forum.kirupa.com/t/sliding-content/173959 "2005-12-31T15:44:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dirksmith](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@dirksmith](https://forum.kirupa.com/u/dirksmith)\
**Post date:** [December 31, 2005, 3:44pm UTC](https://forum.kirupa.com/t/sliding-content/173959/1 "2005-12-31T15:44:26Z")

</div>

hi

I’m developing a site using sliding content - controlled with up and down buttons. But I’m having problems with the positioning ‘degrading’ the more the up / down buttons are pressed:

You can see this here: [http://www.detkendesign.com/detken2/portfolio.htm](http://www.detkendesign.com/detken2/portfolio.htm)

I’m using the AS below for the buttons.

Grateful for any ideas on a fix.

Thanx

Dirk

onClipEvent (load) {  
\_x = 0;  
\_y = 0;  
div = 5;  
}

onClipEvent (enterFrame) {  
\_x += (endX-\_x)/div;  
\_y += (endY-\_y)/div;

```
_root.up.onRelease = function() {
    if(_y&lt;-260){
        endX = 0;
        endY = _y+260;}

```

};

```
_root.down.onRelease = function() {
    if(_y&gt;-1040){
        endX = 0;
        endY = _y-260;}

```

};

}
