Mega Code Archive
Using removeEventListener() method to remove event handler
private function initApp(e:Event):void {
b1.addEventListener("click",myClickHandler);
b2.addEventListener("click",myClickHandler);
b3.addEventListener("click",myClickHandler);
}
private function destroyButtons(e:Event):void {
b1.removeEventListener("click",myClickHandler);
b2.removeEventListener("click",myClickHandler);
b3.removeEventListener("click",myClickHandler);
myVGroup.removeAllElements();
}
private function myClickHandler(e:Event):void {
// Do something here.
}