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

What is Framer? Join the Community
Return to index
Patrick McLean
Posted Mar 09 - Read on Facebook


I’m duplicating 2 different layers X number of times with X different states for each layer using a for loop.

I’d like to switch states for two layers at the same time on an event like this:

product.on Events.MouseOver, (event, product, productName) ->

But I get “undefined is not an object” in reference to productName on the event.

I think there’s some core concept I’m missing. Any ideas?


George Kedenburg III

yeah, .on events don't work this way... could you share a bit more of your code? screenshot is fine

Jordan Robert Dobson

Mainly you can't define the arguments that get passed in, you can only name them. The first will always be the event object the second will be the layer that fired the event.

So essentially what you are doing is replacing, in the scope of this event's function, what product and productName are equal to... So leave that alone there.

Johannes Eckert

what I'd do is setting up the relationship of those layers when you create them, such as "layerA.relatedLayer = layerB", so you can use relatedLayer in your events on layerA:

Patrick McLean

thanks so much for the detailed replies everybody. problem solved on my end. would any of you by any chance have links to documentation i could read to expand my understanding on this stuff? i don't quite have the language to describe the scenario so it's hard finding more info on the web.

Read the entire post on Facebook