Skip to main content
Inspiring
December 14, 2018
Question

Move a movieClip along Y axis from dragging another movieClip (manual scrollBar)

  • December 14, 2018
  • 2 replies
  • 681 views

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

This topic has been closed for replies.

2 replies

Inspiring
December 14, 2018

I'm on a pretty good track I think for solving my issue-

I need a little help getting base driving the y position value from another movieclips y position --

JoãoCésar17023019
Community Expert
Community Expert
December 14, 2018

Hi.

I created a complete scroll pane recently for HTML5 Canvas documents.

Simple(I think) UI question

Please have a look and see if that is what you need.

Regards,

JC

Inspiring
December 14, 2018

Thank you for your help - I have a problem with the fla file that you have on your googleDrive - I can open it in animate, but when I try and run it to see what you did, animate crashes every time.

JoãoCésar17023019
Community Expert
Community Expert
December 14, 2018

Weird.

It's working for me.

Are you using the 2019 version?