how to dynamically remove event listeners ?
I have a graphic keypad made up of key movie clips. When a key is pressed a function is called and actions are performed. Afterwards I want to disable whichever key was pressed by removing the listener. How can I do that dynamically using a string for the listener function name?
Enables a key
keyK.addEventListener(MouseEvent.CLICK, insertConsK);
Disable by removing listener. What is the correct syntax? char="k".
MovieClip(root)["key"+char.toUpperCase()].removeEventListener(MouseEvent.CLICK, ["insertCons"+char.toUpperCase()] );