Re: Recursively searching for named object


Forums > Javascript > Recursively searching for named object

Nat
March 8, 2013 | 5:09 pm

Guys,

This is much easier to do with the applydeep function:

– Pasted Max Patch, click to expand. –

autowatch = 1;

var scripting_name = null;

function findObject(obj)
{

if (obj.varname == scripting_name)
{
post(obj.varname);post();
post(obj.maxclass);post();
}

}

function find(_scripting_name)
{
scripting_name = _scripting_name;
this.patcher.applydeep(findObject);
}