I’m trying to remove all the event listeners from nextBtn. the names of all the possable callback functions are stored in mdpArray. I want to use the for loop to remove all the listeners from nextBtn.
the error message says
cannot convert “mdp1_1” to Function
How can i make this work.
Thank you for your help.
var mdpArray:Array = ["mdp1_1","mdp1_2","mdp1_3","mdp1_4","mdp1_5"];
private function clearEvents(nextBtn):void{
var _nextBtn = nextBtn;
for(var i:Number = 0; i<mdpArray.length; i++){ _nextBtn.removeEventListener(MouseEvent.CLICK,mdpArray*);
}
}