How to use callback function?

The situation is like this I define a sprite and a action
Then I runAction.I want to run some codes when the action is over

The code is like this:
var sprite=cc.Sprite.create(source);
var action=cc.MoveTo.create(1, (200,200));
var sprite.runAction(action);

when the animation is over I want to get some reaction.For example print something

Hi, Jie

EX:
var action=cc.MoveTo.create(1, (200,200)); var finish = cc.CallFunc.create(this.removeSprite, this); var seq = cc.Sequence.create(action, finish); sprite.runAction(seq);

For more details or more complexe usage, it’s really a good way to look up in our API documentation : http://www.cocos2d-x.org/reference/html5-js/V2.2.1/index.html
Search for cc.Sequence on this page.

Huabin

thank you