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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user