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

Slider to control timeline

Engaged ,
May 31, 2018 May 31, 2018

Copy link to clipboard

Copied

Hi there,

I have checked a few posts about controlling the timeline with a slider but I am afraid they may be a bit too advanced for me.

Would anyone recommend a post or a resource which explains the simplest way to have a slider that controls the timeline.

Just the simplest case.

Thank you in advance

B

Views

9.8K

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Jun 01, 2018 Jun 01, 2018

// UPDATE (10/26/2018): improved version that takes into account responsive settings, drag offset and frame to position precision.

The download link is the same.

this.button.on("mousedown", function(e)

{

     e.target.offsetX = (e.stageX / stage.scaleX) - e.target.x;

}.bind(this));

this.button.on("pressmove", function(e)

{

     e.target.x = this.clamp((e.stageX / stage.scaleX) - e.target.offsetX, this.bar.x, this.bar.x + this.bar.nominalBounds.width);

     this.setProportion();

}.bind(this));

this.setPropo

...

Votes

Translate

Translate
Community Beginner ,
Jun 03, 2023 Jun 03, 2023

Copy link to clipboard

Copied

Dear Kglad

Sorry for the confusion, from what I understand from this forum question, it has two parts one constructing the slider, two is moving the moving clip relative to the slider. The code I copied was JoaoCesar response to the slider part, I do want to move a movie clip relative to the slider position, but cant get the slider part to work proplerly as when I change JoaoCesar script to "y" rather than "x". the slider button flies to the top left of the screen and stops, there is no warning in the console of any errors. I hope that clears up what I would like help with, I am sure once I get the slider working your code will work for the movie clip part.

Best Regards Peter

Votes

Translate

Translate

Report

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 ,
Jun 04, 2023 Jun 04, 2023

Copy link to clipboard

Copied

this.button.on("mousedown", function (e){
e.target.offsetY = (e.stageY / stage.scaleY) - e.target.y;
}.bind(this));
 
 
 
this.button.on("pressmove", function (e){
e.target.y = this.clamp((e.stageY / stage.scaleY) - e.target.offsetY, this.bar.y, this.bar.y + this.bar.nominalBounds.height);
//this.setProportion();
}.bind(this));

Votes

Translate

Translate

Report

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 Beginner ,
Jun 04, 2023 Jun 04, 2023

Copy link to clipboard

Copied

Thanks Kglad

I found my problem was due to the clamping function, my scope was wrong . the movie clip I was trying to reference

was inside another clip so the stage referencing was wrong as one showed 8 in y the other 592 in y so the

refencing would not work. Appreciate your help best regards'

Peter

Votes

Translate

Translate

Report

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 ,
Jun 05, 2023 Jun 05, 2023

Copy link to clipboard

Copied

so, problem's resolved?

Votes

Translate

Translate

Report

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 Beginner ,
Jun 05, 2023 Jun 05, 2023

Copy link to clipboard

Copied

Yes thanks for your help

Peter

Votes

Translate

Translate

Report

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 ,
Jun 05, 2023 Jun 05, 2023

Copy link to clipboard

Copied

LATEST

excellent.  and you're welcome.

Votes

Translate

Translate

Report

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