Closed aleafworld closed 4 years ago
Assuming you want to do
sprite.subobj.func.call(sprite.subobj);
then only these arguments are correct:
group.callAll("subobj.func", "subobj");
The default context
is always sprite
, no matter what you pass in method
. It's true that if you pass a deep property in method
you will probably have to pass a matching context as well, I guess the docs could note that.
Thanks.
I think context
can be removed, because it can get by
context = methodLength > 1 ? this.callbackFromArray(child, method, methodLength - 1) : child;
then the code will be simpler.
Closing since it works as described.
Not sure if this is a bug: eg. sprites in group have a method as "sprite.subobj.func()" group.callAll("subobj.func") ---- not work group.callAll("func","subobj") ---- not work group.callAll("subobj.func","subobj") ---- it work
the API ---- "callAll(method, context, args)" don't you think the second paramater is unnecessary?