Delay not working

Delay not working
0.0 0


Hi, I have a sprite image as a background and another sprite image on it. On clicking this sprite image i have to scale my background image and move to next scene which have a sprite image along with some delay. Please help me to work on this.
var familyroomscene = new FamilyRoomScene(); var scaleToA = cc.ScaleTo.create(10, 1, 1); var delay = cc.DelayTime.create(25); this.spriteHome.runAction(cc.Sequence.create(scaleToA,delay,cc.Director.getInstance().replaceScene(familyroomscene)));


cc.Director.getInstance().replaceScene(familyroomscene) IS NOT A cc.Action


Hi cc, Then how could i achieve it i.e. from one sprite i have to scaleTo and move to my next scene.(which contains another sprite image)


if you want to translate to next scene in runAction, wrap the replaceScene code in cc.CallFunc.

if you want to reuse the sprite node in next scene, invoke sprite.removeFromParent, and add it into new scene later.