Ah, I figured out how to fix up my one issue with controllers:

The default behavior of an event is determined by the entity that calls
into the event dispatcher, so the solution was to unify the dispatch of
these events. Created a utility method in CommandEvent to do that, and
did some singlton-like hackery on the constructor to prevent folks from
thinking they can just dispatch these themselves and have it work correctly.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4317 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-08-11 01:22:50 +00:00
parent 1d2c8ae7ac
commit ce5caaedfe
5 changed files with 65 additions and 10 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ public class MenuUtil
new ContextMenuItem(caption, separatorBefore, enabled, visible);
item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
function (event :ContextMenuEvent) :void {
event.mouseTarget.dispatchEvent(new CommandEvent(cmd, arg));
CommandEvent.dispatch(event.mouseTarget, cmd, arg);
});
return item;
}