• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to return name value from Drop Down Menu?

Community Beginner ,
Jun 18, 2020 Jun 18, 2020

Copy link to clipboard

Copied

Hi

 

How do I return the actice name value from a Drop Down Menu? Not the item#, but the name.

The selected names correspond with layer names - and I would like to call them, depending on which item that is chosen.

Fx:

menuName = effect("Target Country")("Menu");

thisComp.layer(menuName).sourceRectAtTime().height;

TOPICS
Expressions , How to

Views

236

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 18, 2020 Jun 18, 2020

Copy link to clipboard

Copied

Pretty sure you can't but the work around would be to write an array in the same order as your dropdown list then use that and the dropdown to pick the array number. Like this:

menuItems = ["Layer name one", "Layer name two", "Layer name three", "Layer name four"];
menuName = effect("Target Country")("Menu").value;
thisComp.layer(menuItems[menuName - 1]).sourceRectAtTime().height;

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 22, 2020 Jun 22, 2020

Copy link to clipboard

Copied

LATEST

Thank you Greg1987! I used your suggestion.

 

I do wish I could retrieve the menu item names somehow - this way it would also serve as a global array of names, which I could use in any layer. Now I need to update several layers, if I add or remove an item from the menu.

 

Thanks again! 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines