Hey Framers,can anyone help me with "mouseover" event inside "for" loop, right now it only response to the last dot while hovering all other dots. Check the source here(http://share.framerjs.com/7ahaxjgg69li/) if it would help, many thanks!!!
dont use dot inside your event, use this or @ (like this.states.switch or @.states.switch)
By the time you mouse over the dot and the event fires... (after code is evaluated, looped, etc) dot variable will have already looped those 6 times so you want it to be relative to the layer that clicked it.
You have a few options:1. Use @.states...2. Use this.states...3. Use layer.states... from the layer argument passed in4. Use the do keyword to create a closure wrapper
For the last one go here: http://coffeescript.org/#loops and scroll down to the last example to see #4 in action.