Move a movieClip along Y axis from dragging another movieClip (manual scrollBar)
I have made a scrollBar (Animate CC doesn't support scrollBars in html5 canvas)
The "scroller" (movieClip with an ID of "scroller") object is set up with a "mousedown" and "pressmove" function -
this.scroller.on("mousedown", function (evt) {
this.offset = {x: this.x - evt.stageX, y: this.y - evt.stageY};
});
this.scroller.on("pressmove", function(evt){
//this.y = evt.stageY + this.offset.y;
if ((this.y < 77)&&(this.y > 40)){this.y = evt.stageY + this.offset.y;}
if (this.y >77.1) {this.y = 76};
if (this.y ==77) {this.y = 76};
if (this.y <41) {this.y = 41};
if (this.y ==41) {this.y = 41};
console.log(this.y);
});
So I can click and drag the scroller up and down the side of the area I want to scroll with boundary's set (between 77 and 40 Y values).
Now I want to take the position value of Y from "scroller" and apply that to my movieClip that is the information that I want to scroll "scrollingTextMC" (movieClip with an ID of "scrollingTextMC" )
Any help would be appreciated.
-sam
