Hey lovely Frameristas,
just a super short question. I want to change text of a textLayer from a function.
I tired something like this and as you might guess it doesn't work: https://framer.cloud/AXCxd/
Would love to hear from you
button.onClick (event, layer) -> theBestText.text = "bar" ## ??????
Patryk Adaś nice, thanks a lot. Is there a way to access/change the variable though?
If you want to change both at the same time...
button.onClick (event, layer) -> theBestText.text = content = "bar"
In your code you create a variable "content" and assign it "foo". Then you create a text layer and assign its text variable whatever is in "content".So far so good. But this only happens once and not continually. So if you now change again "content" to hold "bar" this will not change the theBestText.text. You will need to again set theBestText = content to update it.
thanks a lot Alex