[sharingisfun] make a js array patch


    Feb 02 2006 | 3:25 pm
    typing out an array like: var arrayname = new Array() ; arrayname[1] = "one" ; arrayname[2] = "two" ;
    is boring as the array gets larger. so here is a max patch that generates the array, given a comma-delimited message of arrayname and elements. Just cut and paste from the text window into your js.

    • Feb 08 2006 | 12:25 am
      Hi I tried to create new panel objects using javascript: var a = this.patcher.newobject("panel",100,100,12,12); From this I get: error: patcher: doesn't understand "panel".
      It works when I do it with a toggle: var a = this.patcher.newobject("toggle",100,100, 15, 0); So I checked by stepping trough the patchers objects using the apply method. I get for the Maxobj property maxclass for some of my objects the word "panel". In Max text mode I get for a panel: #P user panel 180 167 12 12; When I try to script to a thispatcher object with the message "script new mypanel panel 100 100 12 12" I get the same error message.
      Is it impossible to create panel objects dynamically? Stefan --