[javascript-dev] js with set function and using javascript to set value...
pnyboer
pnyboer at slambassador.com
Thu May 1 13:46:11 MDT 2008
- Next message: [javascript-dev] js with set function and using javascript to set value...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I'm using this javascript to set values of various max objects:
function anything(){
post("
example",messagename,arguments[0]);
var knob = this.patcher.getnamed(messagename);
knob.set(arguments[0]);
}
if I try to "set" the value of a jsui this way, I get the error:
• error: js: junk.js: Javascript TypeError: knob.set is not a function, line 4
• error: js: error calling function jsknob
But the jsui does have a "set" function in it!
This happens in Max 4x and Max 5.
Here's a patch that illustrates this, call the above javascript "junk.js":
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 101 217 75 196617 <named knob;
#P comment 101 174 75 196617 <named inter;
#P comment 101 149 75 196617 <named floater;
#P user dial 58 199 40 40 128 1 0 0 159 270 1 1. 170 170 170 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P objectname knob;
#P number 58 169 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname inter;
#P flonum 58 143 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname floater;
#P user jsui 58 70 64 64 1 0 0 none;
#P objectname jsknob;
#P message 207 129 199 196617 jsknob 0.5 \, floater 0.6 \, inter 32 \, knob 64;
#P newex 209 150 53 196617 js junk.js;
#P comment 125 71 75 196617 <named jsknob;
#P connect 2 0 1 0;
#P window clipboard copycount 10;
--
* * * *
The Altamont
2 oz light rum
3/4 oz lime juice
1/2 oz orange curaçao
1/4 oz orgeat
splash of pernod
handful of fresh mint leaves
shake contents vigorously with ice.
Strain well into a chilled cocktail glass.
* * * *
- Next message: [javascript-dev] js with set function and using javascript to set value...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
