I'm using Adobe Animate CC for a canvas project. I have an array that I assigned events listeners to like so:
for(var i = 0; i < navBtnArray.length; i++ ){
navBtnArray[i].addEventListener("click", navigationControls);
}
What I am trying to figure out is how to capture the index value of the button that was clicked in the array. I tried like so:
function navigationControls(e){
console.log(navBtnArray.indexOf(this));
}
But that keeps returning -1. Again this is Animate CC so I don't have access to jQuery. Animate uses the CreateJS and EaselJS library. I used to use indexOf in AS3, but it doesn't seem to work the exact same way.