function onSample() { var command = scene.getCommandById("myCmdId"); if (command) { command.setAttribute("value", "myAttributeValue"); } }