'@bgfillcolor', 0.3, 0.3, 0.3, 1 doesn't work for the [message] object


    Sep 19 2022 | 2:46 pm
    Hi all,
    I try to make a message object from Javascript. I have found, the bgfillcolor attribute doesn't work. I always get the default colour.
    I have tried this way : var message = this.patcher.newdefault(x, y , 'message', '@bgfillcolor', 0.3, 0.3, 0.3, 1) And also this way:
    var message = this.patcher.newdefault(x, y, 'message');
     value.setattr('bgfillcolor', 0.3,0.3,0.3,1);

    • Sep 19 2022 | 10:38 pm
      Something like this should work:
      var message = this.patcher.newdefault(x, y, 'message');
      message.setattr('bgfillcolor', 1,0.3,0.3,1);
    • Sep 19 2022 | 10:58 pm
      Hi,
      What is the difference comparison to my code, please?
    • Sep 19 2022 | 11:01 pm
      It looks like you were trying to use setattr() on something other than the message box, 'value'?
    • Sep 20 2022 | 6:56 am
      Hi,
      Oh sorry, it's just an error when rewriting the code here. My bar is named value. To make it clear, I changed the var to message here, but not in both cases. Sorry.
    • Sep 20 2022 | 5:02 pm
      Maybe send along the whole code, as it is working here.
    • Sep 21 2022 | 7:39 am
      Hi,
      The code is like this: var message = this.patcher.newdefault(x, y, 'message', '@varname', 'message', '@presentation_rect', x, y + 40, 40, 20, '@annotation', 'message', '@textjustification', 1, '@bgfillcolor', 0.3, 0.3, 0.3, 1, '@presentation', 1);
      And I have also tried this: var message = this.patcher.newdefault(x, y, 'message'); message.setattr('bgfillcolor', 0.3,0.3,0.3,1);
      None of them is working on my side here (Max 8.3).
    • Sep 21 2022 | 4:02 pm
      Hmm, not sure what could be going on. You could attach a project with all of your dependencies, I'd be happy to take a look.
    • Sep 22 2022 | 7:50 am
      Hi,
      OK, you are right. It works in the empty script. Then I have to do something wrong in the function before.
      Thank you