this.patcher.box.apply…

Apr 1, 2007 at 11:25am

this.patcher.box.apply…

hi,

i’m trying to find all named objects in the parent patch of a bpatcher, by using a js inside that bpatcher.
the this.patcher.apply method does this nicely for objects at the same level as the js object, but how could i do that to the parent?

if i try to do it with this.patcher.box.apply, i get the error message

Javascript TypeError: this.patcher.box.apply is not a function

how could it be possible?
any help appreciated!

thanks,

jan klug

#31114
Apr 1, 2007 at 8:50pm

Guess that should be this.patcher.box.patcher.apply.

apply is a method of the Patcher object. In the javascriptinmax doc, you can see that ‘box’ is a MaxObj object, not a Patcher object.

Hth,
Mattijs

Quote: Jan Klug wrote on Sun, 01 April 2007 13:25
—————————————————-
> hi,
>
> i’m trying to find all named objects in the parent patch of a bpatcher, by using a js inside that bpatcher.
> the this.patcher.apply method does this nicely for objects at the same level as the js object, but how could i do that to the parent?
>
> if i try to do it with this.patcher.box.apply, i get the error message
>
> Javascript TypeError: this.patcher.box.apply is not a function
>
> how could it be possible?
> any help appreciated!
>
> thanks,
>
> jan klug
—————————————————-

#100650
Apr 1, 2007 at 9:01pm

ok, thanks mattijs, that helps me to understand js and its documentation a bit more!
but then.. is there an elegant way to let a js in a bpatcher get to know all the named object in the patcher containing the bpatcher?

dank & groet,

jan

#100651
Apr 1, 2007 at 9:43pm

I don’t think there is a method that directly retrieves an array of all named objects of the containing patcher, if that is what you mean, but with the box or parentpatcher properties it is very well possible to do this. I actually did this before but I don’t think I have the code nearby.

Also have another close look into a general javascript reference. I personally like http://www.javascript-reference.info/ a lot.

Groet,
Mattijs

Quote: Jan Klug wrote on Sun, 01 April 2007 23:01
—————————————————-
> ok, thanks mattijs, that helps me to understand js and its documentation a bit more!
> but then.. is there an elegant way to let a js in a bpatcher get to know all the named object in the patcher containing the bpatcher?
>
> dank & groet,
>
> jan
—————————————————-

#100652
Apr 2, 2007 at 7:26am

ah, this.patcher.parentpatcher.apply did the trick!
how could i overlook parentpatcher..

thanks for the help!

jan

#100653

You must be logged in to reply to this topic.