-
Drop down menu for toolkit.
Hi, Im new to the scripting world and can really use everyone input!
The project I am working on is a team match-up. I have all the team logos inside the comps.
So far I was able to write a short script that first hides all teams and then enables only the team being selected:
Then I have the script that provides the two drop down menu for the Home and Away teams:
Both scripts works fine on its own, was I am having difficulty is to blend them together in one script, Final objective is to be able to select a team tricode from the drop down list and once selected make the team visible within the comp.
Here is the script after i tried to put them together, 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!
Sorry, there were no replies found.