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

What is Framer? Join the Community
Return to index
Mike Kyllo
Posted Apr 15 - Read on Facebook

Hi Framers,

Does anyone know how to setup a nested for loop inside a for loop? That might be a little confusing:

Names = ["Bob", "Mike","Jerry" ]

for i in [0..Names.length]
NamesRow = new Layer
y: 700 + (i * 280)
x: 87
parent: page

for i in [0..Name.length]
NamesSubLayer = new Layer
parent: NamesRow[i]
html: Names[i]


Brian Williams

you can just nest the loop. That said you could probably just map the values you want then use one loop.

im just updating framer one sec.

Brian Williams

im a little lost as to what you are trying to achieve with the second loop though

George Kedenburg III

also you can just do:
for i in Names

Ian McClure

Nesting loops look like

for i in [0..N]
for j in [0..N]
# Do stuff

Mike Kyllo

Sorry to be a hassle but I can't get the sublayers to nest.

Mike Kyllo

They look nested but they are sitting on top

Brian Williams

Take a step back.

What are you trying to achieve?

Brian Williams

Like this? (edited for clarity)

Mike Kyllo

Last question for the week. If I add a page, how do make it visible to work on it? I know this is dumb.

Read the entire post on Facebook