If I understand correctly then to call a function when an object is clicked i would use the following code.
myObject.addEventListener(MouseEvent.CLICK,myFunction);
However what i actually have is an array of objects and i want to call a function with the index of that array passed in as a parameter so that i know which of the objects was clicked, what I would like to do is something like this.
for(a=0;a<100;a++){
myObject[a].addEventListener(MouseEvent.CLICK,myFunction(a));
}
But that doesn’t work, so if someone could suggest a way to achieve what I am trying to do that would be greatly appreciated.