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

What is Framer? Join the Community
Return to index
Baisampayan Saha
Posted Jul 11 - Read on Facebook

Hi....I am facing some problem in accessing layers created by for loop.

I am not being able to initiate a click event, where in when I click the box layer shown in the code, the layers created by for loop will come to various positions of X.

5 Comments

Stephen Crowley

Is it case sensitive? Sorry not near my computer to double check but I see under your click event layer properties x is uppercase instead of lower case.

Baisampayan Saha

ya...X was uppercase....that solved one part of the problem. My bad. But it is not responding to the click event. As soon as I refresh the code, it is getting automatically animated. The layers are also not coming one after another as it should have been, as I have put a delay parameter.

Benjamin Den Boer

Hey Baisampayan Saha - could you share your prototype? I can take a look for you. Also, it may be the space infront of line 19 that's causing issues. Another thing: instead of creating two range loops, you can create a variable outside of your first loop. (allLayers = []) and within your loop, push the layers to the array. (allLayers.push(layer)). Then, within the box Click Event, you can loop over the layers instead: for layer in allLayers... to animate them. :-)

Baisampayan Saha

thanx....let me try that one....:)

Elliott Samuel Lemberger

I have a similar question. Is there a way to target a single layer created by a for loop? Say I want to have one of the layers created by a for loop animate when it is clicked on. How would I achieve that? Thanks!

Read the entire post on Facebook