removeEventListener not working
I'm having trouble removing event listeners from movie clips. As a test I put two MCs on stage: keyB and remover.
I want to pass a parameter to the keyB event listener function. This works fine. But when I try to remove the listener it doesn't work.
keyB.addEventListener(MouseEvent.CLICK, function (evt:MouseEvent):void {keyHandler(evt,"b")});
remover.addEventListener(MouseEvent.CLICK, removeHandler);
function keyHandler(evt:MouseEvent, char:String):void {
trace(char);
}
function removeHandler(evt:MouseEvent):void {
keyB.removeEventListener(MouseEvent.CLICK, function (evt:MouseEvent):void {keyHandler(evt,"b")});
keyB.alpha=.5
}
