I don’t understand the difference between @:bind and the usage of an object method like onClick. Where and when should I use bind, and why? Instead, when & why is better the second way?
Moreover, sometimes it seems that @:bind doesn’t work.
I created an app with some checkboxes. If I try to bind the mouse click event with bind to one of those ones with bind it seems that it doesn’t work, while if I use the onClick method, it does work:
// this one does NOT work
@:bind(checkUpper, MouseEvent.CLICK)
function onCheckboxChange(e:MouseEvent) {
trace("upper");
}
// this one DOES work
checkLower.onClick = function (e) {
trace("lower");
}