Connection Bug


    Aug 06 2006 | 3:34 pm
    Hi,
    Can anybody explain what exactly causes the following bug and how to prevent this from happening?
    I make a js-file containing only this line:
    this.patcher.newobject("number", 200, 260, 35, 9);
    ..and then I connect another object to this one.
    I then save the file, re-open it, and discover that the connection-cord has been replaced...
    This is on a windowsXP system with max 4.5.5

    • Aug 13 2006 | 8:47 am
      Okay, here's another one:
      I create a js-object containing only this line:
      unpack=this.patcher.newdefault(272,90,"unpack", "0.", "0.", "0.");
      I save it, so an unpack-object is made. I then test it and see that this unpack object just won't work. It doesn't generate any output upon receiving a list.
      But if I retype (part of) this unpack-object, it suddenly starts behaving the way it should. The one question arising from all this is "Why?!?"
      Is it just me or has Max gone crazy?
    • Aug 13 2006 | 9:43 am
      > I create a js-object containing only this line: > > unpack=this.patcher.newdefault(272,90,"unpack", "0.", "0.", "0."); > > I save it, so an unpack-object is made. I then test it and see that > this unpack object just won't work. It doesn't generate any output > upon receiving a list.
      it probably does output a list, if you send it a list of symbols, cause that's the way you formatted the unpack object. for floating-point arguments try:
      this.patcher.newdefault(272,90,"unpack", "f", "f", "f");
      also, i guess you should better put your line inside a function, and call that to execute it.
      vol.
    • Aug 13 2006 | 12:11 pm
      Hah!
      Great, it works like a charm now!
      Thanks alot
      ...even though this connection-thing (described in the first message) is still bugging me.
    • Aug 13 2006 | 12:44 pm
      > ...even though this connection-thing (described in the first > message) is still bugging me.
      as i said, it's _not_ recommended to have a scripting command in the global code of your js file. see "JavascriptInMax.pdf" p. 12: "... what not to do: refer to your object's patcher"
      stick it in a function definition and call it _once_. make your connection and save the patch. that should work.
      volker.