Skip to main content
Participating Frequently
August 13, 2021
Question

Drop Down expression with coordinates

  • August 13, 2021
  • 4 replies
  • 589 views

I am trying to use the dropdown expression to move the pointer on a map.  The tutorials I have seen seem to reference other layers.  I just want to change the x,y coordinates of the layer.   Has nayone seen any good documentation on how to do this?   Still learning expressions.  Mostly just used with the pickwhip in the past.   Any help is appreciated.

 

Thanks,
Scott

This topic has been closed for replies.

4 replies

Mylenium
Legend
August 14, 2021

With a slightly clearer head this morning some questions spring to mind: Have you actually edited the enttries in the menu? What type are they? Also rename the effect to something more telling than its default name. Other than that your position outputs should be arrays so you don't need to use conditionals:

 

mMenu=thisComp.layer("Pointer")effect("Positions).value;

mPos=[[100,100],[250,250],[340,340]];

 

mX=mPos[mMenu][0];

mY=mPos[mMenu][1];

 

[mX,mY]

 

Mylenium

Mylenium
Legend
August 13, 2021

"value" is a reserved keyword. You cannot use it as your variable name. Other than that I think the syntax is wrong, but I'm really not sure where that dang post or tutorial can be found that explains it. Sorry for being so useless!

 

Mylenium

Participating Frequently
August 13, 2021

Here is what I have so far.  I get the error "Undefined is not an object"

 

 

thisComp.layer("pointer").effect("Dropdown Menu Control")("Menu");

if (Effect("Dropdown Menu Control").value == 1) value = 100,100;

else if (Effect("Dropdown Menu Control").value == 2) value = 250,250;

 

Any suggestions are appreciated

 

 

Mylenium
Legend
August 13, 2021

You would have to manually populate a custom dropdown control using an enumerated list. This has nothing to do with the automated layer control. It's explained somewhere, but I can't find the link right away...

 

Mylenium