Forums > Javascript

Value of number field in JS

January 23, 2011 | 9:36 pm

Hey,

is there a simple solution for reading the value of a number field in JavaScript?

I am trying this for a while now and cound get it work. Nearest thing here in the forum is this: http://cycling74.com/forums/topic.php?id=25481
But i did not understand the solution.

Would be kind of importand, as i need to get this running until tomorrow.

Thanks for any hint.

/m


January 23, 2011 | 11:34 pm

I imagine by number field you mean something like the [number] or [flonum] objects. This is achievable with javascript by using the getvalueof() method. If you name your [number] object "zulu" you could use something like the line of code below:


outlet(0,this.patcher.getnamed("zulu").getvalueof());

January 24, 2011 | 8:41 am

Oh, I just missed naming the object. Thanks!!

And, yes, I ment the [number] object. As you may imagine, I am quite new to Max/MSP.

/m


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