Got a quickie here:
Best way to return an items array index value and pass to a function?
myFunction = (buttonIndex) -> do something with buttonIndex here
myButtons = [ buttonOne buttonTwo buttonThree]
for layer in myButtons myFunction(buttonIndex)
Just trying to determine the index of a button that was clicked last and pass to myFunction.
Thx in advance!
do this: `for layer, i in myButtons` and then i will be the index
To return the index of the last button clicked, I tried :
print this.i but it returned UNDEFINED. Ideas?