Dynamicly changing arguments for [js]

    Feb 22 2014 | 11:46 pm
    I'm using the example code from the [polybuffer~.maxhelp] file for loading the polybuffer~ using JavaScript in the [js] object. (You can find this example under the "JavaScript" tab in the polybuffer~.maxhelp file.) I need to be able to change the second argument of this [js] file however, the one that sets the target polybuffer~ name. I guess this requires a change to this line of code: var pb = new PolyBuffer(jsarguments[1]);. I don't really know much about JavaScript though. What change do I need to make in order to dynamically change the [js] argument?

    • Feb 23 2014 | 12:55 am
      haven't tested this but should work I think:
      function changeArg(a)
          pb = new PolyBuffer(a);
      then use a message box with [changeArg myNewAwesomeArgument] and send it to the js...
    • Feb 23 2014 | 5:23 pm
      Thanks, MIB. That works great!