Skip to main content
This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
December 23, 2018

1. you should rounded numbers for your buttons, scroller, mask and content height and y properties.

2. you'll need to hard code the mask height and y (eg, mask_mcH and mask_mcY, resp.).

3. use linear interpolation to determine the content's y when the scroller is dragged:

4. in the loop you start when dragging of the scroller starts, use content.y=m*scroller.y+b;

5. in your button listeners, adjust your content's y property and check if its extremes have been exceeded.

interpolateF(this.upbutton.y+this.upbutton.nominalBounds.height,mask_mcY,this.downbutton.y-this.slider.nominalBounds.height,mask_mcY+mask_mcH);

var m,b;

function interpolateF(x1,y1,x2,y2){

m = (y1-y2)/(x1-x2);

b = y1-m*x1;

}