I wonder if anyone can help me.
I put together a simple prototype that has 6 products, each with an image and then a heart icon.
The heart icon is made up of two separate layers, an off state and an on state. The off state is visible by default and the on state is invisible.
I want to simply toggle the states once the user has tapped on them.
I can do this if I manually position all the elements and name everything individually, but I thought I would try and create everything using a loop.
I can toggle the first layer on/off using 'this', but not the second layer.
Here is a snipper that runs inside the loop, there was another bunch of set up code, but I have removed for brevity.
Thanks in advance
for index in [0...5]
myLayer = new Layer
myOtherLayer = new Layer
myLayer.onClick (event, layer) ->