Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all articles
Browse latest Browse all 2143

Adding a scrollbar to control Opacity with scripting?

$
0
0

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:

para preguntar scroll bar.JPG

{

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);

  }


Viewing all articles
Browse latest Browse all 2143

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>