The problem was twofold. First there has to be a texture defined for the animation, and second, if it should be a continous animation, than the animFrames have to of type animationFrame. The working code is as follows (put in the ctor function of the helloworld example):
// Create sprite and set attributes
this.mostafa = cc.Sprite.create(res.Mostafa_single_png);
this.mostafa.attr({
x: size.width / 3,
y: size.height / 3,
scale: 0.5,
rotation: 0
});
this.addChild(this.mostafa, 0);
// Load sprite frames to frame cache, add texture node
cc.spriteFrameCache.addSpriteFrames(res.Mostafa_plist);
var mostafaTexture = cc.textureCache.addImage(res.Mostafa_png),
mostafaImages = cc.SpriteBatchNode.create(mostafaTexture);
this.addChild(mostafaImages);
var animFrames = [];
var str = "";
for (var i = 1; i < 9; i++) {
str = "mosquito_fly" + (i < 10 ? ("0" + i) : i) + ".png";
var spriteFrame = cc.spriteFrameCache.getSpriteFrame(str);
var animFrame = new cc.AnimationFrame();
animFrame.initWithSpriteFrame(spriteFrame, 1, null);
animFrames.push(animFrame);
}
var animation = cc.Animation.create(animFrames, 0.08, 100);
var animate = cc.Animate.create(animation);
this.mostafa.runAction(animate);