Hi,
I am moving a sprite using cc.MoveTo.create(); and want to remove the sprite after moving is done .
This is implemented in c++ for simple game as :
CCFiniteTimeAction* actionMove = CCMoveTo::create( (float)actualDuration,
ccp(0 - target~~>getContentSize.width/2, actualY) );
CCFiniteTimeAction* actionMoveDone = CCCallFuncN::create);
target~~>runAction( CCSequence::create(actionMove, actionMoveDone, NULL) );
I have tried to do this as
var actionTo = cc.MoveTo.create(10,cc.p(x,0));
var actionMoveDone = cc.CallFunc.create(this,this.spriteMoveFinished);
this.ball.runAction(actionTo);
but it gives me an error , Uncaught TypeError: Object # has no method ‘call’ when the object has finally moved to destination .
Please tell me how to do it.