XML Feeds

.

[javascript-dev] Javascript documentation.

Emmanuel Jourdan c74-mailinglists at e--j.com
Tue May 20 06:34:44 MDT 2008


On 20 mai 08, at 11:04, Stefan Tiedje wrote:

> Emmanuel Jourdan schrieb:
>> You can use the send message. Then the syntax will be the same as  
>> the one demonstrate in the "Making new objects" subpatcher of the  
>> thispatcher help file. For instance:
>
> I tried this for instance:
>
>    this.patcher.message("script", "newobject", "newobj",
>                    "@varname", "ctlobj[" + k + "]",
>                    "@patching_rect", 250+k*30, 50, 280+k*30, 70,
>                    "@text", ctlin, k+1
>                    );
>
> And it complained:
>
> js: autosurface.js: Javascript ReferenceError: ctlin is not defined...

it should proabably be:

"@text", "ctlin " + k+1

> The js reference claims: "Any message to a patcher that you can send  
> in Max (via the thispatcher object) you can send in Javascript in js."
>
> How do I send the size message: "script size var1 100 15" like in  
> the example to thispatcher?
>
> I tried
>
> this.patcher.size(controlin[k], 27, 15);
>
> but it didn't work. Maybe because the the object doesn't have a  
> scripting name yet...


Then you need to name it:

controlin[k].varname = "ctrlin_" + k;
this.patcher.message("script", "size", "ctrlin_" + k, 100, 15);

You should also be able to use the rect property of a MaxObject.

ej



More information about the javascript-dev mailing list