This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Terry Tien
Posted Jul 23 - Read on Facebook

Hello again guys!
Is there a way to reference a variable and make it the dynamic content of a text layer? And also how to get a dynamic textlayer?
Basically I mean making the dynamic dayNum show on the screen.

http://share.framerjs.com/4i3kyfzbeygp/

5 Comments

Aitzaz Bin Sultan

idk

Aitzaz Bin Sultan

i can post framer js source code if that helps

Brian Williams

Learn about closures ... you can reference things in the same scope or the scopes above it.

Rich Zarick

yes, very easily! if you want to use a variable inside of any string field, wrap it like so: "#{variablename}"

for text layers, try this module: https://github.com/awt2542/textLayer-for-Framer

for your example, in your slider change:value function, you'd set textlayer.text = "#{daynum}"

Trevor Phillippi

I also made a module specifically for using numbers. This allows you to decide how a number should be formatted, and then just update the number of the layer itself and it will update: https://github.com/tjphilli/Framer-ValueLayer

Read the entire post on Facebook