Forum Replies Created

Page 3 of 3
  • Hi Xavier! I see you have wide experience with Dropdownlist. Let me ask you a question as well. I have an after effects project with a composition loaded with team logos. I was able to create a Dropdownlist that will automatically gather the names of the layers to populate the drop down list.

    then, the scripts requests to all layers be disabled so when one is selected from the drop down, only the selected team becomes enabled. This is what I am having problems with, I’m not sure how to connect this part of the script with the Dropdownlist so it recognizes the selected team to enable it.

    Here is the script:
    The ?????? is what I believe its missing for it to work, not sure what to write there:

    var myWin = new Window(“palette”, “Drop down list”, undefined);
    var proj = app.project;
    var awayComp = proj.item(2);
    var homeComp = proj.item(3);
    var myList = new Array();

    for(var i=1; i <= awayComp.numLayers; i++){
    myList[myList.length] = awayComp.layer(i).name;
    }

    var groupOne = myWin.add(“group”, undefined, “GroupOne”);
    var dd = groupOne.add(“dropdownlist”, undefined, myList);
    dd.selection = 0;

    dd.onChange = function() {

    for(var i = 1; i < awayComp.layers.length +1;i++){
    //Hides all visible layers
    awayComp.layer(i).enabled = awayComp.layers.enable = false;
    // check name
    if(awayComp.layers[i].name == ?????? {
    // turn into opposite
    awayComp.layers[i].enabled = !awayComp.layers[i].enabled;
    }
    }
    };

    myWin.center();
    myWin.show();

    Hope it makes sense!

    Please, I will truly appreciate all your help!

Page 3 of 3

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy