First of all , thanks to David Torno (http://www.provideocoalition.com/after-effects-extendscript-training-complete-series).
With the help of their tutorials I managed to make several scripts with UI, but when I try to add a Scrollbar I can`t. Someone can tell me what I'm doing wrong ? Here's the code:
{
function myScript(thisObj)
{
function myScript_buildUI(thisObj){
var myPanel = (thisObj instanceof Panel)?thisObj : new Window ("palette", "Opacity", undefined, {resizeable:true});
res="group{orientation:'row', alignment:['fill','fill'], alignChildren:['fill','fill'],\
groupOne: Group{orientation:'column',alignment:['center','center'], alignChildren:['fill','center'],\
},\
myPanelOne:Panel{text:'Opacity',orientation:'column',alignment:['fill','fill'], alignChildren:['fill','center'],\
myScrollbar1:Scrollbar{text:'Opacity'},\
},\
}";
myPanel.grp=myPanel.add(res);
var myScrollbar1 =myPanel.grp.myPanelOne.myScrollbar1;
var valueScroll =myPanel.grp.myPanelOne.myScrollbar1.value;
myScrollbar1.onChanging=function () {
var curItem = app.project.activeItem;
var selectedLayers = curItem.selectedLayers;
var curLayer = curItem.selectedLayers [0];
var Opacity= curLayer.property("ADBE Transform Group").property("ADBE Opacity");
Opacity=valueScroll;
}
return myPanel;
}
var myScriptPal= myScript_buildUI(thisObj)
;
if((myScriptPal != null) && (myScriptPal instanceof Window)){
myScriptPal.center();
myScriptPal.show();
}
}
myScript(this);
}