method addCommand

command addCommand(string id,string action);

Argumente

Zurückgegebener Wert

This method returns a command object created for the given ID and action, or null if scene failed to create the object.
function onSample()
{
    var commandGroup = scene.getCommandGroupById("cmdGrp1");
    if (commandGroup)
    {
        var command = commandGroup.addCommand("myNewCmd", "myNewActionMethod();");
        if (command)
        {
            command.setUpdate="myNewUpdateMethod();";
        }
    }
}