- (void) runAnimationDAnim
{
CCAnimate * animate = [CCAnimate actionWithAnimation:dAnim];
CCCallFunc * func = [CCCallFunc actionWithTarget:self selector:@selector(onCallFunc)];
CCSequence * seq = [CCSequence actions:animate, func, nil];
[zombieSprite runAction:seq];
}
// this work
- (void) onCallFunc
{
[zombieSprite runAction:[CCMoveBy actionWithDuration:2 position:ccp(200,200)]];
}
// this does not work
- (void) onCallFunc
{
CCAnimate * animate = [CCAnimate actionWithAnimation:walkAnim];
CCSequence * seq = [CCSequence actions:animate,nil];
[zombieSprite stopAllActions];
[zombieSprite runAction:seq];//
}
What do you mean by "this does not work"? Does the execution reach this method? What is the error you are getting? Depending on the error, may be your walkAnim is nil? post the error from the console.