A newer version of Max is available. Click here to access the latest version of this document.

live.toggle

Switch between off and on (0 and 1)

Description

The live.toggle object creates a toggle switch that outputs a 0 turned off and a 1 when turned on.

Arguments

None.

Messages

bang A bang message will toggle the state of the object. If it is off, it will switch on and output a 1. If it is on, it will switch off and output a 0.
int input [int]
Switches the live.toggle on (1) or off (0) and send the value to the outlet.
float input [float]
Same as int.
assign assign-input [float]
The word assign, followed by a floating point value, causes that value to be stored and displayed and sent out the live.toggle object's outlet. If the Parameter Visibility attribute is set to Stored Only, the assign message will not add the new value to the Live application’s undo chain.
init Restore and output the initial value.
(mouse) A mouse click on the live.toggle object switches the object on if it is off, or off if it is on.
outputvalue Sends the current value out the outlet.
set set-input [float]
Switches the live.toggle on or off without causing any output.

Attributes

Name Type g/s Description
active int
def.:1
Toggles the object's active mode. When active is set to 0, the mouse action does not cause output and the inactive colors are used.
activebgcolor float Sets the background color displayed for the toggle in the off state when the active attribute is set to 1.
activebgoncolor float Sets the background color displayed for the toggle in the on state when the active attribute is set to 1.
bgcolor float Sets the background color off displayed for the toggle in the off state when the active attribute is set to 0.
bgoncolor float Sets the background color on displayed when the active attribute is set to 0.
bordercolor float Sets the display color for the live.toggle object's border in RGBA format.
focusbordercolor float Sets the display color for the live.toggle object's border when the object has focus in RGBA format.

Information about attributes available for Parameter-aware objects

Information for box attributes common to all objects

Examples

See Also

Name Description
live.button Flash on any message, send a bang
live.tab A user interface tab/multiple button object
live.text A user interface button/toggle
toggle Switch between off and on (0 and 1)