Call a function after an action completes

i need to call the function “move” after the completion cc.moveTo action…i tried this method but its not working … please help…

var func=new cc.CallFunc(this.move());
this.sprite.runAction(cc.Sequence(cc.moveTo(2, 100, 200)),func);
var a = 0;

“inside move function”

move:function(){
if (a==0) {
this.sprite.runAction(cc.rotateTo(2, 90, 90));
}

this.sprite.runAction(cc.sequence([
    cc.moveTo(2, 100 ,200), 
    cc.callFunc(function(){
    //you function ....
}, this)
]));
1 Like

thank a lot… It worked well :smiley: