array of newobject of type "Number Box"

Dec 3, 2007 at 4:39pm

array of newobject of type "Number Box"

Hi,

I am trying to dynamically create an array of objects and this works fine for toggle, e.g

a = patcher.newobject(“toggle”,122,90,15,0);

but how do you create a newobject for “Number Box” as it fails e.g

a = patcher.newobject(“Number Box”,122,90,15,0);

is the space in the string a problem, any help much appreciated.

#34870
Dec 3, 2007 at 5:29pm

On 03 Dec 2007, at 17:39, Liam Donaghy wrote:

>
> Hi,
>
> I am trying to dynamically create an array of objects and this
> works fine for toggle, e.g
>
> a = patcher.newobject(“toggle”,122,90,15,0);
>
> but how do you create a newobject for “Number Box” as it fails e.g
>
> a = patcher.newobject(“Number Box”,122,90,15,0);

try “number” instead.
and you will need some more arguments.
to find out about the format you can open a max patch as text and
inspect the argument list of the objects.
vb

#118221
Dec 3, 2007 at 8:18pm

Hi Vb,

Thanks a lot, I have opened the patch as text and used the full list of parameters.

Opened as text :

#P number 116 22 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;

to javascript :

var object_array = new Array(128);
object_array[k] = this.patcher.newobject(“number” ,116, 22, 35, 9, 0, 0, 0, 3, 0, 0, 0, 221, 221, 221, 222, 222, 222, 0, 0, 0);

Parameters 2 + 3 (116 + 22) control the object positioning

#118222

You must be logged in to reply to this topic.