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

reset slider

Advocate ,
Aug 09, 2017 Aug 09, 2017

Copy link to clipboard

Copied

I found this discussion very interesting and useful

Re: change opacity levels individually

I wanted to know if you could add a reset button

To reset the sliders.

TOPICS
Actions and scripting

Views

795

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 , Aug 09, 2017 Aug 09, 2017

Yes, you can reset a slider in a UI or say on the opacity level of a layer. For the layer, you would have to get the scriptlistener code for changing the opacity and apply that to your UI script. Here's a sample on doing it with a slider within a script UI:

var sDefault = 34;

var dlg = new Window('dialog','Slider Test');

var sdr = dlg.add('slider',undefined,34,0,100);

    sdr.size = [400,30];

var txt = dlg.add('statictext',undefined,sdr.value);   

var btn = dlg.add('button',undefined,'Reset Slider');

...

Votes

Translate

Translate
Adobe
Community Expert ,
Aug 09, 2017 Aug 09, 2017

Copy link to clipboard

Copied

LATEST

Yes, you can reset a slider in a UI or say on the opacity level of a layer. For the layer, you would have to get the scriptlistener code for changing the opacity and apply that to your UI script. Here's a sample on doing it with a slider within a script UI:

var sDefault = 34;

var dlg = new Window('dialog','Slider Test');

var sdr = dlg.add('slider',undefined,34,0,100);

    sdr.size = [400,30];

var txt = dlg.add('statictext',undefined,sdr.value);   

var btn = dlg.add('button',undefined,'Reset Slider');

sdr.onChanging = function(){txt.text = sdr.value}

btn.onClick = function(){

    sdr.value = sDefault;

    txt.text = sdr.value;

    }

dlg.show()

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