From 783b5ef33d94e807ed522b2abdb95c816d33fdf6 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Wed, 19 Jul 2006 22:25:30 +0000 Subject: [PATCH] Be sure to call super() in our clickHandler so that selected state toggles when toggle mode is true. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4278 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/mx/controls/CommandButton.as | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/as/com/threerings/mx/controls/CommandButton.as b/src/as/com/threerings/mx/controls/CommandButton.as index d0315032f..5b6bae2f0 100644 --- a/src/as/com/threerings/mx/controls/CommandButton.as +++ b/src/as/com/threerings/mx/controls/CommandButton.as @@ -31,8 +31,14 @@ public class CommandButton extends Button override protected function clickHandler (event :MouseEvent) :void { - dispatchEvent(new ControllerEvent(_cmd, _arg)); - event.stopImmediatePropagation(); + super.clickHandler(event); + + if (enabled) { + // stop the click event + event.stopImmediatePropagation(); + // dispatch the command event + dispatchEvent(new ControllerEvent(_cmd, _arg)); + } } /** The command to submit when clicked. */