Using thispatcher object with cycle object
Anyone have any experience with using the thispatcher object with the cycle (no tilde) object?
I am trying to get thispatcher to create a named instance of cycle, but it keeps thinking that @varname is an extra attribute.
Any ideas?
hello rs-232...very interesting! but as you can see in this patch it s irrelevant with the thispatcher object...also it s beyond cycle as the same happens to many other objects which cannot take as argument directly the "varname"... i am very curious to learn why this happens...
and now i see that none non- UI object can take "varname" as argument directly... you can create an "uzi @varname pluxi" object but uzi does not accept "pluxi" as his varname as you can see on the inspector unless you send it with a message "sendbox varname pluxi"...i don t know if this is the normal behavior..
Thanks tada, what I'm gathering here is that thispatcher seems to really be meant only for UI and non UI object just work spottily if at all. Really unfortunate, because you have to connect the UI to something, and if you are trying to dynamically generate functionality within a patch as I am trying to do, it becomes almost more trouble than its worth. : /
Have you thought of using javascript to create objects? I find it much easier, especially if the [thispatcher] route starts becoming complicated. Here's an example that will accept the following message: "create", x co-ordinate, y co-ordinate, object name, argument1, argument2... argumentx, varname. The final item in the list will be used as the new object's scripting name. Perhaps an example is best. Save the javascript below and then send it the message "create 100 100 cycle 5 wasabi" et voilà!
function create() {
var args = arrayfromargs(arguments);
var varname = args.splice(args.length-1);
var obj = this.patcher.newdefault(args);
obj.varname = varname;
}
You can't name no-UI objects with the varname attribute, as you discovered. But you can create a newobj object which is the UI object which hold any non-UI object, like this:
Yes, the examples in the MAX docs describe that javascript is the way.
thanks Emmanuel...someone doesn' t read his lesson well as as he should do ...it s inside thispather help...