Hey Frameristas, I need some help with come coffescript logic. Essentially what I'm trying to do is trigger some magic when the y value of a layer falls between a range. What am I doing wrong?
Can you share the project? It'll make it a lot easier to provide support.
"if" In Your code on line 18 will be called only once. What You need is to check y position on scroll. Try to pack it to some function which returns true or false and then on scroll event write something like:if checkYPosition(sketch.Prototype.P1.y) // here you set opacity
If you want to continously watch for a value change, use the layerYouWantToWatch.on "change:propertyYouWantToWatch", -> event listener to get that value.
Also it looks like your condition is incorrect on line 18: you are saying the y should be smaller than 200 AND bigger than 700 at the same time. Which can never be true.
If you want it to be between these values you should flip the sign on the first condition.
Or if you want it to be below OR above this range switch from AND to OR.
I have the same question regarding using y position to trigger certain conditions.