bugreport: patcher object not initialized before loadbang when duplicating abstraction.


    Nov 12 2006 | 7:01 pm
    Dear cycling,
    I use a loadbang to post the varname of the containing patcher but I get the following errors:
    • error: js: getName.js: Javascript TypeError: this.patcher.box has no properties, line 2 • error: js: error calling function bang
    This only happens when duplicating or reloading the abstraction that contains the javascript. When I load the whole patch, it works. When I trigger the js with patchergs, everything is fine.
    Steps to reproduce: 1) save the patches below 2) load openMe.pat, the max window will show 'withLoadbang' and 'withPatcherargs' 3) duplicate the abstraction 'withPatcherargs'. the max window will show 'withPatcherargs[1]' 4) duplicate the abstraction 'withLoadbang'. the max window will show the error messages
    Max 4.5.7. on Windows XP
    save as "withLoadbang.pat":
    save as "withPatcherargs.pat":
    save as "openMe.pat":
    save as "getName.js":
    function bang() { post(this.patcher.box.varname); post(); }
    Hope you can confirm, Mattijs

    • Nov 12 2006 | 7:12 pm
      On 12 nov. 06, at 20:01, Mattijs Kneppers wrote:
      > Dear cycling, > > I use a loadbang to post the varname of the containing patcher but > I get the following errors: > > • error: js: getName.js: Javascript TypeError: > this.patcher.box has no properties, line 2 > • error: js: error calling function bang
      Hi,
      Did you tried the loadbang() method from the object?
      Best, ej
    • Nov 13 2006 | 9:24 pm
      Quote: Emmanuel Jourdan wrote on Sun, 12 November 2006 20:12 ---------------------------------------------------- > Hi, > > Did you tried the loadbang() method from the object? >
      Yeah, it has the same problem.
      > Best, > ej > > ----------------------------------------------------