[Resolved]How to use CallFunc?

Hi, saw the API documentation and tried searching for examples, but I don’t see what I’m doing wrong.

What I want to do is: after the animations that are run toghether in a Spawn I want another animation to fire on another node. Is there a better (/working) way to do this?

var actRotar = cc.RotateTo.create(2, 0); actRotar = cc.EaseElasticOut.create(actRotar,0.4); var actEscalar = cc.ScaleTo.create(2, 1, 1); actEscalar = cc.EaseElasticOut.create(actEscalar, 0.4); var actEsfumar = cc.FadeOut.create(1.5); var actAparecer = cc.FadeIn.create(1.5);

this.sprite.runAction( cc.Sequence.create( cc.Spawn.create( actRotar, actEscalar), actEsfumar, cc.CallFunc.create(this.helloLabel.runAction,actRotar) ) );

I’ve also tried the following with no luck: (althought in this case it tells me “helloLabel is not defined”, adding “this.” doesn’t help either as I guess I’m in another scope in there…)

this.sprite.runAction( cc.Sequence.create( cc.Spawn.create( actRotar, actEscalar), actEsfumar, cc.CallFunc.create(function(){ helloLabel.runAction(actRotar); }) ) );

I’m currently getting a “this.getActionManager is not a function” error on line 3119 of “cocos2d/base_nodes/CCNode.js”. I’m guessing I have a really dumb error going on here.

try these codes,please:

this.sprite.runAction( cc.Sequence.create( cc.Spawn.create( actRotar, actEscalar), actEsfumar, cc.CallFunc.create(function(){ this.helloLabel.runAction(actRotar.clone()); }, this) ) );

This is my test code on HelloHTML5World:
this.helloLabel.runAction(cc.Spawn.create(cc.MoveBy.create(2.5, cc.p(0, size.height - 40)),cc.TintTo.create(2.5,255,125,0), cc.CallFunc.create(function(){this.circle.runAction(cc.MoveTo.create(1.5,cc.p(size.width/2,size.height/2)));},this)));
it works well.

Dingping Lv wrote:

this.sprite.runAction( cc.Sequence.create( cc.Spawn.create( actRotar, actEscalar), actEsfumar, cc.CallFunc.create(function(){ this.helloLabel.runAction(actRotar.clone()); }, this) ) );

That worked just fine, thanks! Althought I tried deleting that “.clone()” and it worked the same without it (it only appears to be needed if that action has to be executed in parallel with itself).
I guess I was just missing the “, this” after that closing bracket as the second parameter of CallFunc.create.

EDIT: another finding I’ve made is that this usage is also valid (and perhaps more to the linking of certain developers):
var that = this; this.sprite.runAction( cc.Sequence.create( cc.Spawn.create( actRotar, actEscalar), actEsfumar, cc.CallFunc.create(function(){ that.helloLabel.runAction(actRotar.clone()); }) ) );