sleep(5 sec )

Please, somebody! Need something like the function sleep(5 sec). Or the best variant how to run a function only after the previous function with some animation finished.
I know about CCSequence::actions(…). But I don’t have access to the objects which are animated in this class. I have access only to the some static methods. So I can’t use CCSequence and so on…
Please help! I need it very urgent!

:slight_smile: Should better look into examples! Found it out! But still have questions.
So I have created such sequence
@
CCFiniteTimeAction* action = CCSequence::actions(
CCCallFuncN::actionWithTarget(this, callfuncN_selector( GameLayer::method1)),

CCCallFuncN::actionWithTarget(this, callfuncN_selector( GameLayer::method2)),

CCCallFuncN::actionWithTarget(this, callfuncN_selector( GameLayer::method3)),

CCCallFuncN::actionWithTarget(this, callfuncN_selector( GameLayer::method4)),

NULL);
@

but this sequence didn’t work as I expected. The last action didn’t ‘wait’ while the previous one is finished.
WHY???

So I decided to use CCDelayTime::actionWithDuration(time)
And then it began to work.
So in the end of my discovering I have such code(Don’t sure that it is correct, but anyway….maybe somebody will have similar question):
@
CCFiniteTimeAction* action = CCSequence::actions(
CCCallFuncN::actionWithTarget(this, callfuncN_selector( GameLayer::method1)),
CCDelayTime::actionWithDuration(time),
CCCallFuncN::actionWithTarget(this, callfuncN_selector( GameLayer::method2)),
CCDelayTime::actionWithDuration(time),
CCCallFuncN::actionWithTarget(this, callfuncN_selector( GameLayer::method3)),
CCDelayTime::actionWithDuration(time),
CCCallFuncN::actionWithTarget(this, callfuncN_selector( GameLayer::method4)),

NULL);
this->runAction(action);
@