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

What is Framer? Join the Community
Return to index
Elliott Malkin
Posted Jan 27 - Read on Facebook

I have 5 layers: face1, face2, face3, face4, face5.

I want to transform each of these layers with a loop rather than writing out the statement 5 times. But I can't quite get the correct syntax. Here's the idea:

for x in [1...6]
y = "face" + "#{x}"
y.scale = .5
print y, y.scale

When I print y, I do get face1, face2, face3, face4, face5. But y.scale is "undefined."

What am I doing wrong?


George Kedenburg III

try something like this

Matt Baxter

George has a good solution.

But, the reason why yours was wrong is because y was just a string, not an object. So, it doesn't have a scale property.

Elliott Malkin

I see. Thanks. That makes a lot of sense. Now let's say I don't want to write out that entire array by hand. Let's say I have 100 face layers!

Read the entire post on Facebook