Hey all!I’m trying to figure out how to pass an Arrayindex from the layer inside that array?
So imagine there is 10 layers in array and I have a for loop for them.
for i in [0…10] ArrayA[i].on Events.MouseOver, -> print this.array.index
The reason I want this so I could have multiple arrays, and having MouseOver one layer, it triggers a bunch a layers from different arrays with the same array index each.
To fix it, you can do a few things. I always like to use the map function, but a pro trick is to use do:
I tried this out too, but I think I fail to understand it. This example works (layers in second row move based on mouseover on first layers in first row): http://share.framerjs.com/o77rv447emwy/ But if I don't instantiate the layers in the scope of "do" but upfront it won't work anymore. Now why is that? Probably that's kind of the point of using "do", but leaves me clueless.