Actionscript 2
mc1.onRelease = function() { } mc1.onRelease = null;
Actionscript 3
import flash.events.MouseEvent; // if on timeline we don't need this line mc1.addEventListener(MouseEvent.CLICK, mc1_click); function mc1_click(e) { } mc1.buttonMode = true; // to have hand cursor when over it mc1.removeEventListener(MouseEvent.CLICK, mc1_click); // to remove action
Further differences:
1. if something is covering it, it won’t work even if invisible it will not work
2. function need to have one parameter or it will not work.
3. we need to remeber to remove this listeners when not needed or we’ll cause memory leaks