Arguments to reference who sent message in JS function

Dec 17, 2009 at 8:10pm

Arguments to reference who sent message in JS function

In JS is there a way to get the name or object reference of who called the function? If I have a message box named “Bert”, is there a way to grab that name/reference say in a function anything()? This is regarding directly connected and non connected js objects.

#47258
Dec 18, 2009 at 7:12am

Hello maxers,

Have you try something like that ?

function anything()
{
var a = arrayfromargs(messagename,arguments);
post (a[0],”n”) ;
}

Perhaps, i don’t understand your question, in case : please post a patch to explain your problem.

Salutations.

#169995
Dec 18, 2009 at 11:00am

Javascript doesn’t know how objects are connected together so this isn’t currently possible. The workarounds are to either use a different inlet or to [prepend name] the value so you can target it with a global funcyion.

lh

#169996
Dec 18, 2009 at 3:52pm

Thanks. I was contemplating prepend. Would you happen to know the answer to my other post, it’s driving me nuts:

http://cycling74.com/forums/topic.php?id=23478

#169997

You must be logged in to reply to this topic.