Skip to main content
theMinehamster
Participant
September 22, 2018
Answered

Unable to setValue() in a Slider

  • September 22, 2018
  • 1 reply
  • 1536 views

Hello everyone!

I am currently working on a project that needs to memorize certain values. So I tried to do this by writing them into a Slider but however I try it, there always is the error that ".setValue() is not a function". I have no idea what I am doing wrong. I can read the value at any time, but there seems no way to change it. Here is the line:

thisComp.layer("Regler").effect("EndeG")("Schieberegler").value;                    works!

thisComp.layer("Regler").effect("EndeG")("Schieberegler").setValue(1);          does not work!

Can someone explain that to me, cause in other (older) forum discussion they said, that this definitly should work.

Thanks in advance!

Dan

This topic has been closed for replies.
Correct answer Dan Ebberts

You'll get an error like that if you try to use setValue() in an expression. It only works for scripting, not expressions. Another possible issue is that an expression can't affect the value of another property. It can only alter the value of the property hosting the expression. Also, expressions have no memeory, so any value generated by the expression won't be accessible to that expression on other frames.

Dan

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
September 22, 2018

You'll get an error like that if you try to use setValue() in an expression. It only works for scripting, not expressions. Another possible issue is that an expression can't affect the value of another property. It can only alter the value of the property hosting the expression. Also, expressions have no memeory, so any value generated by the expression won't be accessible to that expression on other frames.

Dan

theMinehamster
Participant
September 22, 2018

Ohh, I didn't know these differences. Thank you very much!