Application/runtime with a javascript object and matrix

fraction's icon

Hi all,
i m kind of facing a problem of understanding how js objects vs reference to matrix within the patch are integrated to max in runtime/application. A javascript code that works pretty well either as patch, project etc, is no longer working if you export that same project as run time application.

To illustrate that, i m going to use this little cutie by Frederic foderaro, because it's where i got introduced to javascript in max, and i keep reproducing somehow mistakes from there. I m therefore kind of a newbie on js.

When you take that exact patch and try to make an application, the code send a reference error. I miss something, because for other project i tend to reproduce the same kind of error. What do you have to add for runtime which is not necessary for regular patch?

Can someone explain me what's going on?

thx!

Max Patch
Copy patch and select New From Clipboard in Max.

point.js
text/javascript 1.10 KB