this.patcher.parentclass always returns null??

Apr 13, 2007 at 3:16am

this.patcher.parentclass always returns null??

For this structure:

[p [p [p [js]]]]
Inside that js, shouldn’t the this.patcher.parentclass property be “patcher”?

It’s always null here…

Example:

parent.js
——————-
function bang()
{
post(this.patcher.parentclass + “n”);
}
——————-

Patch:

#P button 415 89 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#N vpatcher 10 59 610 459;
#P inlet 36 60 15 0;
#P window setfont “Sans Serif” 9.;
#N vpatcher 377 307 977 707;
#P inlet 50 70 15 0;
#P window setfont “Sans Serif” 9.;
#N vpatcher 231 192 831 592;
#P inlet 209 100 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 209 128 63 196617 js parent.js;
#P connect 1 0 0 0;
#P pop;
#P newobj 50 101 30 196617 p;
#P connect 1 0 0 0;
#P pop;
#P newobj 36 94 31 196617 p;
#P connect 1 0 0 0;
#P pop;
#P newobj 415 113 32 196617 p;
#P connect 1 0 0 0;
#P window clipboard copycount 2;

#31357
Apr 13, 2007 at 9:56am

Confirmed. Max 4.6.2.

From the docs, the return value can only ever be “patcher” or null, right? Strange property altogether.

I assume you can use the parentpatcher property for a workaround.

Mattijs

Quote: johnpitcairn wrote on Fri, 13 April 2007 05:16
—————————————————-
> For this structure:
>
> [p [p [p [js]]]]
> Inside that js, shouldn’t the this.patcher.parentclass property be “patcher”?
>
> It’s always null here…
>
> Example:
>
>
> parent.js
> ——————-
> function bang()
> {
> post(this.patcher.parentclass + “n”);
> }
> ——————-
>
> Patch:
>
> #P button 415 89 15 0;
> #P window setfont “Sans Serif” 9.;
> #P window linecount 1;
> #N vpatcher 10 59 610 459;
> #P inlet 36 60 15 0;
> #P window setfont “Sans Serif” 9.;
> #N vpatcher 377 307 977 707;
> #P inlet 50 70 15 0;
> #P window setfont “Sans Serif” 9.;
> #N vpatcher 231 192 831 592;
> #P inlet 209 100 15 0;
> #P window setfont “Sans Serif” 9.;
> #P window linecount 1;
> #P newex 209 128 63 196617 js parent.js;
> #P connect 1 0 0 0;
> #P pop;
> #P newobj 50 101 30 196617 p;
> #P connect 1 0 0 0;
> #P pop;
> #P newobj 36 94 31 196617 p;
> #P connect 1 0 0 0;
> #P pop;
> #P newobj 415 113 32 196617 p;
> #P connect 1 0 0 0;
> #P window clipboard copycount 2;
>
—————————————————-

#101791

You must be logged in to reply to this topic.