Addressing TextButton Label Text via Javascript?
Hi Whale Bone,
One way of doing it is to just send a message to the object, using 'myobject.message()':
inlets = 1;
outlets = 1;
autowatch = 1;
p = this.patcher;
var textvalues = ["Off","On"];
function ToggleButton(a) {
if (a==0) { Setting=0; } else { Setting=1; }
var b=p.getnamed("buttonOnOff");
b.message("text", textvalues[a]);
}
Thanks so much! I had tried that, but I realize now that I'd forgotten to include the "text" argument. D'oh! So simple.
Thanks again.
Alternately, you can set the attr like this:
b.text(textvalues[a]);
-Ben
Thanks again. That's very helpful.