Hi Dan
Thank you for taking your time to answer.
Yes, as you see in my script of my panel(Thanks to David Torno)
Here i have my slider button.
res = "group{orientation: 'row', alignment:['fill','fill'], alignChildren:['fill','fill'],\
groupOne: Group{orientation:'column' , alignment:['fill','fill'], alignChildren:['fill','fill'],\
myButton: Button {text: 'My Button'},\
myStaticTxt: StaticText {text: 'HAMID'},\
myCheck: Checkbox{text: 'CheckBox'},\
mySlider: Slider{text: 'Slider', value:30},\
myClose: Button {text: 'Close'},\
Here you see i have assigned the group to myPanel and aslo my variable declaration of my button to the slider
//Assigning a group to myPanel add a res to it
myPanel.grp = myPanel.add(res);
//How buttons are assigned to function
var mySliderBTN = myPanel.grp.groupOne.mySlider;
var pushBTN = myPanel.grp.groupOne.myButton;
And here is what i have managed so far for actual pressing the button.
//THIS IS THE FUNCTION FOR THE SLIDER CONTROL
mySliderBTN.onChange = function() {
alert("Slide me");
}
So I guess this output exactly the same as the short little function you described.
But my initial thougts was how do i actually link a parameter to the click of the button.
I want the slider to work as slider control for a selected layers opacity, going from 0 to 100.
The basics i know is to set the parameter for the opacity on a layer i could write:
var curItem = app.project.activeItem;
var selectedLayer = curItem.selectedLayers;
var curLayer = curItem.selectedLayers[0];
var opaCity = curLayer.property("Transform").property("Opacity").setValue(50);
But to actualy have the slider button dynamicly from 0 to 100, here I am a bit lost…
/HRB