From 920a9df3ac3c42aef52c6668693af96caa983b8d Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Tue, 20 Mar 2007 03:47:11 +0000 Subject: [PATCH] Allow a function to be specified here, too. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@174 ed5b42cb-e716-0410-a449-f6a68f950b19 --- src/as/com/threerings/flash/MenuUtil.as | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/as/com/threerings/flash/MenuUtil.as b/src/as/com/threerings/flash/MenuUtil.as index cbe293f3..57f07bc2 100644 --- a/src/as/com/threerings/flash/MenuUtil.as +++ b/src/as/com/threerings/flash/MenuUtil.as @@ -34,7 +34,7 @@ public class MenuUtil * Create a menu item that will submit a controller command when selected. */ public static function createControllerMenuItem ( - caption :String, cmd :String, arg :Object = null, + caption :String, cmdOrFn :Object, arg :Object = null, separatorBefore :Boolean = false, enabled :Boolean = true, visible :Boolean = true) :ContextMenuItem { @@ -42,7 +42,7 @@ public class MenuUtil new ContextMenuItem(caption, separatorBefore, enabled, visible); item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, function (event :ContextMenuEvent) :void { - CommandEvent.dispatch(event.mouseTarget, cmd, arg); + CommandEvent.dispatch(event.mouseTarget, cmdOrFn, arg); }); return item; }