I have a couple of layers created with a for loop. I'm trying to make the hovered layer to actually play an animation with "this":
layer.on Events.MouseOver, -> layer.states.switch("hover")
However, it only works for the last created layer. Any tips?
do (layer) -> layer.on Events.MousOver, ->
Hey Davey, thanks for the reply! Unfortunately it didn't work :(
This is my code: for i in [0...5] layer = new Layer x: 80 + i*250 y: 100 name: "layer" + i borderRadius: 10
layer.states.add default: shadowBlur: 0 scale: 1 hover: shadowBlur: 50 scale: 1.25
do (layer) -> layer.on Events.MouseOver, -> layer.states.switch("hover")
This works for me: http://share.framerjs.com/bqmtooxrhhic/
Yeah, really weird, cause I opened your project and then did the same thing I did with your code and it was working. Anyway thanks man!
Oh by the way, you don't really have to define a default state since the idea of states is that you can toggle between the default (how the layer is defined) and other states