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
This commit is contained in:
Ray Greenwell
2007-03-20 03:47:11 +00:00
parent a75658d7b0
commit 920a9df3ac
+2 -2
View File
@@ -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;
}