Forums > Javascript

Set minimum and maximum of newly created flonum

November 19, 2008 | 8:58 am

Hello,

When I create a flonum with javascript like this:

theflonum = this.patcher.newdefault(300, 300, "flonum");

I can give it a scriptingname:

theflonum.varname = "flonum[0]";

But why can’t i give it a min and max value? I tried:

theflonum.minimum = 0.;
theflonum.maximum = 1.; //With and without parenthes

and

theflonum.min = 0.;
theflonum.max = 1.; //With and without parenthes

I got the names from the attributes list (ctrl click on a inlet)

I’m using Max 5.0.5 on MacOS 10.5.4


November 19, 2008 | 12:15 pm

spent a whole day with a syntax problem like this yesterday.

try

theflonum.message(‘min’, 0);
theflonum.message(‘max’, 1);

and make sure you send this, after you created and wired theflonum.

jrp


November 19, 2008 | 12:45 pm

Thanks, this works perfect!


November 19, 2008 | 6:42 pm

Does it work if you try:

theflonum.min = 0;

i.e. without the period after the zero. This is a common way to denote a float in max, although i’m not sure if js likes it.


November 20, 2008 | 2:08 pm

Id did try that, but it doesn’t work.


Viewing 5 posts - 1 through 5 (of 5 total)