There is no way to make a Bpatcher and include in Presentation Mode?!?
Apr 02 2014 | 2:57 am
- Apr 02 2014 | 9:26 amDoing stuff with bpatchers is slightly different to normal objects, you need to send a message to the 'box'. i can't try this at the moment, but I think this should do it:this.patcher.message( 'script', 'sendbox', 'bpatcher_name', 'presentation', 1 );
- Apr 03 2014 | 1:49 amWow - That is it. Combined with your answer on the other forum, I got it! Thanks a lot. One of the other issues is that since this.patcher.message('script', 'sendbox', 'bpatcher_name', 'presentation', 1); requires the bPatcher to have a "varname" property, I had to set that.Normally I have been setting properties as such: objVariable.message("varname", "happy"); but that does not work in bPatcher.I had to use bpatcherVariable.varname = 'happiest'; Interestingly, this method does not work for something like a message box (where the .message() has to be used);Can you explain to me why I can set the bPatcher varname property how I would in any JS code, but I have to "message" properties to other objects?Also, might I ask how you knew about the this.patcher.message(a, b, c, d, e); code? I'm so happy it's working but I do not see that code or the "sendbox" argument anywhere in the documentation. Thanks
- Apr 04 2014 | 9:01 amin the first case: a.message("varname", "message_varname"); you can do: a.varname = "message_varname";so this is consistent - you should be able to access all properties in this way on the js objects.in the second, if you read the excerpt I posted from the doc it does say "There is currently only one object, bpatcher, in which the object and box are different objects. The box is a bpatcher, and the object is a patcher". this is why we need to use sendbox to talk to the bpatcher.using this.patcher.message sends a message to the target - this is not necessarily a property(attribute) - it's a message - open up the thispatcher reference and you'll see the first entry is script - then look further down and you'll see sendbox... i agree this stuff is a bit different to get your head round to start with, in a way you have to think of a bpatcher as 2 things at one - the actual bpatcher object itself and then what it contains and then you understand that you need to be able to address these things in 2 different ways