# Can you see my mistake ? conversion

**URL:** https://forum.kirupa.com/t/can-you-see-my-mistake-conversion/236234
**Category:** flash
**Created:** [August 18, 2007, 7:40pm UTC](https://forum.kirupa.com/t/can-you-see-my-mistake-conversion/236234 "2007-08-18T19:40:20Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Cecile](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@Cecile](https://forum.kirupa.com/u/Cecile)
#### Post date: [August 18, 2007, 7:40pm UTC](https://forum.kirupa.com/t/can-you-see-my-mistake-conversion/236234/1 "2007-08-18T19:40:20Z")

</div>

Hi,

I have a vertical slider that works great, I did try to convert it to a horizontal slider changing all values of height to width and y x to y but it does not work.

Please can someone help me??

Here is the original code:

targY=0;

dragger.\_x = 370;  
line.\_x = 370;

dragger.onPress=function(){  
startDrag(this,false,this.\_x,0,this.\_x,theMask.\_height-this.\_height);  
}

dragger.onRelease=dragger.onReleaseOutside=function(){  
stopDrag();  
}

theText.setMask(theMask);

theText.onEnterFrame=function(){

```
scrollAmount=(this._height-(theMask._height/1.3))/(theMask._height-dragger._height);

targY=-dragger._y*scrollAmount;

    this._y-=(this._y-targY)/5;

```

}

Here is my modified code that does not work for horizontal

targX=0;

dragger.\_y = 370;  
line.\_y = 370;

dragger.onPress=function(){  
startDrag(this,false,this.\_y,0,this.\_y,theMask.\_width-this.\_width);  
}

dragger.onRelease=dragger.onReleaseOutside=function(){  
stopDrag();  
}

theText.setMask(theMask);

theText.onEnterFrame=function(){

```
scrollAmount=(this._width-(theMask._width/1.3))/(theMask._width-dragger._width);

targX=-dragger._x*scrollAmount;

this._x-=(this._x-targX)/5;

```

}
