Could someone help me to control a property with a slider in a UI?
I'm using a UI dockable template from "David Torno", and using rd. Gimme Prop Path, as Tomas Sinukas teach me earlier...
but I can not seem to get the UI slider to control the Slider of my Text Tracking property.
What the hell am I doing wrong?
Thank for all adobe community!
// I have only one TEXT layer in my Comp, with a Tracking Animator inside text properties//
// here is the script I'm trying to use //
{
function myScript(thisObj) {
function myScript_buildUI(thisObj) {
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "My Panel Name", [0, 0, 300, 300]);
res= "group{orientation:'column', alignment:['fill', 'fill'], alignChildren:['fill', 'fill'],\
myStaticText: StaticText{text:'StaticText Text'},\
myEditText: EditText{text:'EditText text'},\
myButton: Button{text:'Button Name'},\
myCheckbox: Checkbox{text:'Checkbox Name'},\
myRadioButton: RadioButton{text:'RadioButton Name'},\
myDropDownList: DropDownList{properties:{items:['Item 1 Name', 'Item 2 Name', 'Item 3 Name', 'Item 4 Name']}},\
myListBox: ListBox{properties:{items:['Item 1 Name', 'Item 2 Name', 'Item 3 Name', 'Item 4 Name']}},\
mySlider: Slider{text:'my slider', value:500, minvalue:0, maxvalue:1000},\
mySliderValue: StaticText{text:'mySlider', },\
myGroup: Group{orientation:'row', alignment:['fill', 'fill'], alignChildren:['fill', 'fill'],\
myGroupItem1: Button{text:'Hi'},\
myGroupItem2: Button{text:'Hello'},\
myGroupItem3: Button{text:'Goodbye'},\
},\
myPanel: Panel{text:'Panel Name', orientation:'column', alignChildren:['right', 'fill'],\
myPanelItem1: Button{text:'One'},\
myPanelItem2: Button{text:'Two'},\
myPanelItem3: Button{text:'Three'},\
},\
myTabbedPanel: Panel{type:'tabbedpanel', text:'Tabbed Panel Name', orientation:'column', alignChildren:['right', 'fill'],\
myTab1: Panel{type:'tab', text:'Tab 1', orientation:'column', alignChildren:['right', 'center'],\
aButton1: Button{text:'Button1'},\
},\
myTab2: Panel{type:'tab', text:'Tab 2', orientation:'column', alignChildren:['left', 'center'],\
aButton2: Button{text:'Button2'},\
},\
},\
myProgressBar: Progressbar{text:'Progressbar Name', minvalue:0, maxvalue:100, value:50},\
}"
//Add resource string to panel
myPanel.grp = myPanel.add(res);
// controllers
var trackingTextSrc = app.project.item(1).layer(1).property("ADBE Text Properties").property("ADBE Text Animators").property(1).property("ADBE Text Animator Properties").property("ADBE Text Tracking Amount").value;
var sld1 = myPanel.grp.mySlider;
// onClickEvents
sld1.onClick = function(){
trackingTextSrc.setValue(sld1) ;
}
// DropDownList default selection
myPanel.grp.myDropDownList.selection = 2;//Item index starts at 0
//Setup panel sizing and make panel resizable
myPanel.layout.layout(true);
myPanel.grp.minimumSize = myPanel.grp.size;
myPanel.layout.resize();
myPanel.onResizing = myPanel.onResize = function () {this.layout.resize();}
return myPanel;
}
var myScriptPal = myScript_buildUI(thisObj);
if ((myScriptPal != null) && (myScriptPal instanceof Window)) {
myScriptPal.center();
myScriptPal.show();
}
}
myScript(this);
}