Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Explorer ,
Dec 14, 2018 Dec 14, 2018

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

624
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2018 Dec 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 14, 2018 Dec 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2018 Dec 14, 2018

Weird.

It's working for me.

Are you using the 2019 version?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 14, 2018 Dec 14, 2018

Yes, latest version - as soon as I press "control+enter" to preview the file - Animate crashes and I have to restart Animate

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2018 Dec 14, 2018

Is the src folder in the same directory of the FLA?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 14, 2018 Dec 14, 2018

yes it is

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2018 Dec 14, 2018
LATEST

Here is a demo:

index

What I can suggest to you is to create a new FLA and copy and paste the assets and code from my files, trying to follow closely my settings.

Regards,

JC

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 14, 2018 Dec 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 --

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines